« first day (877 days earlier)      last day (4068 days later) » 

3:00 PM
@SamDeHaan If you are on the PHP channel, can we even call you "people" ?
 
@ereOn That's racist.
 
OH MY GOD
my brain is melting
 
@JerryCoffin Then I guess I have compiler problems.
 
awesome //cc @Cat
 
I used to do PHP, you know. But I'm cured now.
 
3:00 PM
@EtiennedeMartel Racist applies only to humans. Right ? And as far as I know, PHP is for mutants or aliens, or jellyfishes.
 
Not using Visual C++ thsi time.
 
@GamesBrainiac What compiler are you using?
 
@EtiennedeMartel Our relationship will never be the same again.
 
Its not MinGW
 
@GamesBrainiac what the fuck
 
3:02 PM
GCC 4.7.2 supports this.
I use it almost everyday.
 
@R.MartinhoFernandes Dunno, must be doing something wrong.
 
@R.MartinhoFernandes Hey, that was, what, five years ago?
I've been clean for five years. Not too bad.
 
In some countries, PHP developers and rape victims fall under the same legal category.
 
@EtiennedeMartel You're lucky so far. Remission for five years. You may get away without a relapse, but keep on taking the tests.
 
user1357851
I did PHP 10 years ago, I was a poor uni student & there was this part time C++ job turned into PHP coding thing
 
3:04 PM
@MartinJames That whole episode made me incredibly intelorant of PHP, though.
Like how a former smoker gets angry at people who smoke.
 
I tried to learn PHP once. The person teaching it to me couldn't even get hte opening and closing php tags to work. I quickly abandoned ship.
 
Okay I just had a funny idea while brushing my teeth. Is typename = decltype( [](T foo) { return foo.is_this_member_present; } ) an immediate context?
 
I can honestly say that I've never thought about immediate contexts while brushing my teeth
16
 
room topic changed to Lounge<C++>: PHPers anonymous [c++] [c++11] [c++-faq] [no-helpdesk]
 
@jalf What about funny ideas though?
 
3:06 PM
Every single time I enter this room, you're currently ranting about PHP...
 
@LucDanton You have weird ideas when brushing your teeth.
 
Fuck you guys.
 
So, there's a 12-step program?
 
@LucDanton what did you expect? :)
 
@NikiC This is the first time I enter this room and tey're ranting about PHP (I'm laughing really hard). I thought I was just lucky.
 
3:07 PM
@LucDanton it could be a symptom of poor hygiene. Have you seen a dentist recently?
 
"My name is Martin James and I'm a PHP developer". Never want to have to say that in some locked room.
 
@NikiC PHP is the most terrible language ever which makes it a nice ranting topic
 
@jalf Help.
3
 
"Last night I was alone... my wife had just left me and I... I wrote a small PHP script to rename a bunch of files..."
 
> error: lambda-expression in unevaluated context
I don't even
 
3:10 PM
Anyone up for some TF2 madness ?
 
@LucDanton Take two cyanide capsules and call me in the morning.
 
'We admitted we were powerless over PHP - that our scripts had become unmanageable.'
 
@LucDanton Drink alcohol.
 
@EtiennedeMartel Alcohol is not the answer. Alcohol is the question -- and "Yes!" is (always) the answer.
 
> We built a massive standard library of Puppet modules optimized for Boxen to manage everything from running MySQL to installing Minecraft.
 
3:16 PM
> and implicitly-defined functions that are needed to determine the result of the template argument substitution
what the heck are implicitly defined functions?
 
@JerryCoffin Also, wine is cheap in France.
 
The lucky bastard.
 
Is a default constructor always required?
 
Ugh, answering Perl questions.
 
3:18 PM
@Jueecy Depends.
 
@EtiennedeMartel 'tis true -- and the cheap wine is quite good, no less. Unfortunately (though I've tried) I've never hauled quite enough back in one trip for the savings to pay for the plane ticket.
 
Xeo
@LucDanton Didn't remember that one? :)
 
@TonyTheLion I'd assume he's talking about things like compiler-generated constructors, assignment operators, etc. (but haven't read it to be at all sure).
 
@EtiennedeMartel, assume I have a class MyFile class that opens and edits the specified file. Like: MyFile f("file.data"); f.edit(...);.
 
@Xeo Waking up very slowly today.
 
3:19 PM
@JerryCoffin oh, I'm trying to understand immediate contexts
also, I'm braindead
 
@Jueecy Required by what
 
@Jueecy If a class has no default constructor, then it is not default constructible. Some parts of the standard library (such as some containers) require it.
But it's not a requirement of the language per se.
 
Xeo
I want a clean solution to the auto problem, but there doesn't seem to be one that allows both perfect-deduction, specification of whether to copy/move or not, and is consistent. Fuck this. :<
 
@EtiennedeMartel, would you allow things like MyFile f; f.open("file.data"); in my class?
@CatPlusPlus, common sense?
 
@Jueecy No, because I never liked the "construct then initialize" approach.
 
3:21 PM
> error: definition of 'struct<lambda>' inside template parameter list
I don't know that one.
 
Late opening can make sense, but constructing a file without a filename doesn't
 
@Jueecy MyFile f ("file.data"); makes a lot more sense
 
@JerryCoffin It's much easier here - just need a large van and ferry ticket.
 
@CatPlusPlus It can make sense if you want to reopen a file later.
 
@EtiennedeMartel, me neither. And it would add a lot of stupid if (isOpened()) in all the edit functions.
 
3:22 PM
@Jueecy Yes. Open in constructor, throw if open failed.
 
File::open should return a stream or something
 
That way you know you always have a valid file.
 
@EtiennedeMartel, ok. Thanks.
 
(That is, of course, if your file class represents a file that's opened)
 
> must instantiate A<int&>
 
3:22 PM
There are file operations that don't require file to be opened
 
isn't A<int&> already an instantiation?
 
If it's something that represents an "abstract pathway" (like Java's File or .NET's FileInfo), then it might not be necessary.
 
@EtiennedeMartel, it represents data in a single file, therefore yes.
 
Although it still at least needs a path.
So, anyway, no default constructor.
 
@EtiennedeMartel That should be a "stream" class, not a "file".
 
3:24 PM
@EtiennedeMartel Is that a problem - passing filespec as ctor parameter?
 
@R.MartinhoFernandes Very good point.
@MartinJames You should at least validate if the path is valid.
But otherwise, such an instance could refer to a file that doesn't exist.
 
@EtiennedeMartel Only syntactically.
 
@R.MartinhoFernandes Yes, that's what I meant.
 
lol, found this:
Sep 19 '11 at 20:05, by R. Martinho Fernandes
Snow is not silly. Snow is cool.
 
For instance, File, in Java, has a exists() method. So you can create a File instance with a path that doesn't point to any file.
 
3:26 PM
@EtiennedeMartel Throw on open fail.
 
@MartinJames If it's a file and not a stream, then the constructor should not open it.
@Jueecy Oh, by the way, that should really be a memory map.
 
@EtiennedeMartel Right - just check if it exists.
 
@MartinJames As I said, it does not need to exist.
Perhaps it's an "abstract file".
That you want to create later.
 
GCC performs a hard error. I guess the context isn't immediate then?
 
@EtiennedeMartel The path to its potential location should exist, yes?.
 
3:29 PM
@LucDanton Better than a soft error.
@MartinJames Perhaps.
 
... no, it is not
 
@BartekBanachewicz Panic, presumably :)
 
room topic changed to Lounge<C++>: Happy birthday, Mr. Adams. [c++] [c++11] [c++-faq] [no-helpdesk]
2
@BartekBanachewicz I think Tony already shared that here.
 
@EtiennedeMartel this just in, at least on 9gag.
 
3:34 PM
Oh, a day full of bad puns etc. re. 'Hitchhikers' :(
 
So long, and thanks for all the fish.
That guy died so young, though.
 
..and there we go.. :)
 
Oh, no SFINAE in default function parameter. What matters is the signature (e.g. argument types).
 
Xeo
@LucDanton There's actually a question about that open on SO
Wait, default function parameters or default template parameters?
 
Function.
 
Xeo
3:38 PM
Hm... actually, I think that doesn't differ too much from whether default template parameters cause SFINAE.
 
Bwahaha, new trick: non-type template parameters.
 
uh, okay, I have created another pendrivebuntu
 
Xeo
@LucDanton Wut?
Richard Smith sent a query to the CWG about that, so we'll see. :<
 
main.cpp:8:77: error: expression '#'lambda_expr' not supported by dump_expr#<expression error>' is not a constant-expression
 constexpr std::true_type test(int = 0, dummy<[](T& t) { return t.bar, 0; } ()> = {})
                                                                             ^
main.cpp:8:78: internal compiler error: in strip_typedefs_expr, at cp/tree.c:1395
 constexpr std::true_type test(int = 0, dummy<[](T& t) { return t.bar, 0; } ()> = {})
Victory!
3
 
3:39 PM
@LucDanton because you broke a compiler again?
 
Xeo
@LucDanton Full source?
 
@LucDanton Ever thought about getting a job as compiler breaker? :)
 
Wait a tick, I'm checking what GCC does for lambda exprs in constant exprs.
 
So, I'm replacing a custom dynamic array class with std::vector.
 
@EtiennedeMartel good man
 
3:41 PM
I got this feeling of deja vu.
 
Well, normally it errors. But sometimes it dies apparently.
 
Xeo
I like the "error: expression 'error message' is not a constant-expression" part
 
@EtiennedeMartel Weren't you replacing a custom string like, last week?
 
@R.MartinhoFernandes do you think it is so easy to replace all that code? It's a lot of typing!
 
@R.MartinhoFernandes Friday, yes.
I succeeded.
 
3:45 PM
 
Xeo
@LucDanton Click share :P
 
Something like constexpr auto i = Zero(/* put lambda expr here */); appears to work, although it's of course not reliable.
How about I make myself some coffee. Also clothes.
 
You're knitting?
 
minicraft should support more clothes
 
Urgh, Objective-C code.
 
3:47 PM
Pro-tip: I messed something up.
 
Xeo
Wow, that even kills Clang
unexpected statement kind
UNREACHABLE executed at /home/funatics/llvm/llvm/tools/clang/lib/AST/ItaniumMangle.cpp:2387!
Good work, @Luc
 
I'm a compiler whisperer, but I only say naughty things.
3
@Xeo What about something more simple like the integral constant above?
 
@EtiennedeMartel What do you mean?
 
Oh, it should work. R. Smith did recommend something like static constexpr auto a = false ? addr(/* lambda expr */) : nullptr; to someone else after all.
 
Xeo
@LucDanton Wait, where did you put that?
 
3:54 PM
@BartekBanachewicz, like what? You can always make yourself a proper skin.
 
@Jueecy Your "File" should not contain the file's data.
 
@Jueecy don't. use. the word. make
 
@Xeo In main. It's a sanity check to see what compilers have to say about it. The two reasonable outcomes I can foresee is complaining about a lambda expr in a constant expr, or since it's not even used just going on with it.
 
can you think when you are angry ?
resentful ?
HAHAHAHAAAHAHAAHAHAAAAAA
 
@EtiennedeMartel, why not?
 
Xeo
3:56 PM
> /home/funatics/blargh/main.cpp:21:27: error: constexpr variable 'i' must be initialized by a constant expression
 
@EtiennedeMartel, the file contains the binary representation of a QMap (much like an std::map).
 
Is that a VM you set up for variadic templates? :p
 
Xeo
@LucDanton :3
Not only, though
 
@Xeo can you think when you are unemployed and broke?
can you learn ? @Xeo
 
And the class load that binary data in a real QMap for editing and then at the end saves the changes to the file again.
 
3:57 PM
HAHAHAHAHAHAAAAHAAAAAAAAHAAAAAAAAAAAAAA
 
@Mhjr what the fuck it is all about
 
nothing
don't ... kick.... me... plz
 
so how about a nice cup of shut the fuck up?
 
ok
 
Xeo
@BartekBanachewicz Ahaha, I got that nutjob on ignore.
 
3:58 PM
@Jueecy Oh, Qt? Carry on, then.
 
@Xeo that explains things
 
I meant that you should memory map the file, not read it in a buffer.
 
Xeo
Just spam-flag it.
 
wtf
I came in peace
 
@Xeo Scroll down to implementation. How can that be accepted but my Zero won't?
 
3:59 PM
@Mhjr you'll go back in pieces
(always wanted to say that)
 
(Btw there's that RETURNS macro.)
 
Life is a pain without auto.
 
Xeo
@LucDanton It never gets evaluated. You remember you can do return false ? throw "foo" : ...; in a constexpr function, right?
 
@EtiennedeMartel, is it really ok then?
 
Pigocalypse is up to 'more than 3,300'
 
Xeo
4:01 PM
blargh/main.cpp:21:18: warning: unused variable 'i' [-Wunused-variable]
  constexpr auto i = false ? Zero([]{}) : 42;
 
Oh um I guess I can't do that. Will never SFINAE out then.
 
Xeo
Yea
 
Xeo
@Jueecy He can't be new, else I wouldn't have plonked him
 
Okay, new goal: extract lambda type (much like that Pythy thing), force instantiation of the closure via &T::operator().
 
Xeo
4:02 PM
Also, that Pythy still invokes UB. Suckers.
 
@Xeo I tried arguing with the guy, didn't care for it.
 
@Jueecy I honestly have no idea because I don't know what your needs are.
 
I don't get what the use of this is: liveworkspace.org/code/3VO98g$17
 
@Mhjr What the fuck.
 
Xeo
I wonder why he doesn't use a function pointer - probably because it can't be inlined, huh.
 
4:04 PM
@EtiennedeMartel, I have to store data of a chart in a file for reading / writing. Chart data are stored as a QString key and a double value. Therefore the QMap<QString, double> map is the format of the data stored in the file. During the execution of the program I may need to edit the chart data and then obviously save it to its corresponding file.
 
Okay, I get a hard-error already.
 
@LucDanton that's what she..
 
@EtiennedeMartel, I was thinking that a ChartFile class should represent the data in the file. The file is read upon construction and a buffer is created. All edits goes into the buffer and then the buffer is saved via file.save().
 
Oh right, function parameter again. Coffee needs to kick in already.
> main.cpp:14:105: internal compiler error: in strip_typedefs_expr, at cp/tree.c:1420 constexpr std::true_type test(int, dummy<instantiate(false ? addr([](T& t) { return t.bar; }) : nullptr)> = {})
 
Xeo
I really wonder how that Pythy thing does multi-line return type deduction, though
It doesn't rely on the compiler extension to do that...
 
4:08 PM
|| unexpected statement kind
|| UNREACHABLE executed at ~/clang/llvm/tools/clang/lib/AST/ItaniumMangle.cpp:2385!
 
@TonyTheLion Looks like an explicit instantiation. If you explicitly instantiate all the types you use, you can avoid putting the entire template in a header.
 
@Xeo This isn't about that! Focus man!
 
Xeo
@LucDanton :<
 
@JerryCoffin sorry, not sure what you mean? You have to define the template no matter what no?
 
@LucDanton The part I find truly puzzling is the use of "ItaniumMangle". Maybe started specific to Itanium, but ended up used for all 64-bit code?
@TonyTheLion Yes, but you can move the definition to a .cpp file instead of a header.
 
4:10 PM
blergh Itanium
 
Xeo
@BartekBanachewicz The Itanium ABI is actually pretty sane, from what I heard.
 
@JerryCoffin true, and how does that make my statement useful? I don't see what I can do with it, besides just having it there? (sorry I'm somewhat braindead today)
 
@JerryCoffin With constant expressions/decltype sometimes bits of the signature have to be mangled as well. Not so long ago I hit a GCC bug with something like template</* */> auto operator()(Lhs&& lhs, Rhs&&) -> decltype( std::declval<Lhs>().*std::declval<Rhs>() ); about 'mangling dotstar' or such.
At least that's what I concluded. I really have no idea.
 
@TonyTheLion You put that in one .cpp file. Then, you can use the template (instantiated over that type) from another source file, without having the template in a header so it's all directly visible in the second file.
 
@Xeo What I have so far. instantiate isn't even done and compilers are dying left and right (GCC 4.7.2 appears to die earlier than 4.8, too).
 
4:13 PM
@JerryCoffin oh I think I get it
 
Xeo
$ clang++ main.cpp -std=c++11 -stdlib=libc++
$
@LucDanton ^ kekeke
 
lol
I don't feel like updating my Clang right now though.
 
Xeo
Nah, yours kills it still
I just moved it to template parameters
 
> main.cpp:6:10: sorry, unimplemented: mangling dotstar_expr
@JerryCoffin ^
 
Xeo
lawl
 
4:20 PM
> main.cpp|16 col 63 error| definition of 'struct __lambda0' inside template parameter list
Hit that one earlier as well.
 
Xeo
Your first version works too, btw, if moved to template parameter list
 
@Xeo Which one would that be?
 
Xeo
37 mins ago, by Luc Danton
Or the transformed version?
 
k
Wait, 'it works' not only means 'the compiler doesn't die' but also 'test produces useful results'?
Well, until I transform the non-type default template param into a non-type parameter pack. Then the second assertion triggers.
 
Xeo
@LucDanton It doesn't trigger the asserts, so, yes?
 
4:30 PM
@Xeo Do you understand how awesome that is?
 
Xeo
@LucDanton Welp, I remember that one :s
 
So, Clang limitation?
 
Xeo
Yea
@LucDanton Basically being able to test any and all code if it's valid? Mmm, yeah.
 
template<typename T, RequiresUsage<Test([](T& t) { return t.bar += 3; })> = 0>
constexpr std::true_type test(int)
{ return {}; }
Now trying to make it look nice, keeping in mind I already have a template<typename... C> using Requires;.
 
0
Q: Changing the Stack Memory from C program

Emil TomI am new to stackoverflow, so I apologize in advance for any mistakes I commit. I have come across this C puzzle Recently. The program is given below. #include<stdio.h> void change() { } int main() { printf("\nHello"); change(); printf("\nHai); printf("\nHow are you?"); return 0;...

the fuck?
 
Xeo
4:32 PM
You don't like abusing decltype for expression SFINAE, huh? :P
 
Err nevermind, Requires is about hard-error. Damn, that means the technique must be used in tandem with a non-type EnableIf.
@Xeo Remember when I was trying to improve on Boost.Concepts? It has a BOOST_CONCEPT_USAGE macro which is very, very handy.
 
Xeo
Mhm
 
template<typename T> struct Swappable { T lvalue; BOOST_CONCEPT_USAGE() { lvalue.swap(lvalue); } }; kind of deal.
 
Xeo
I see
 
The big gain is when you put all the required expressions/statements together in the same usage.
 
Xeo
4:35 PM
Yeah, that was one of the advantages I could see with the lambda version
You can also easily disallow certain syntax, I guess.
 
Yeah that return isn't even needed. You can use it if you go [](T& t) -> int { return t.bar; } for instance but that's very much a special-case.
 
Xeo
Although I'm not sure why exactly one would want that.
I kinda wonder how that plays with "unused result" warnings, though, if you do t.bar + 3;.
Cause that would be a lot of noise.
 
Sanity check: I can't refactor Usage<Test(/* thingy */)> right? I need the call to the constexpr function, and I must put it somewhere.
 
Xeo
@LucDanton I think so
 
@Xeo I don't have those.
 
Xeo
4:38 PM
Wait, sec.
 
does anyone here know of a language that doesn't have all of the sounds needed to say the English word "atom"?
or does anyone know how I could check such a thing?
 
Xeo
@LucDanton You don't want macros, right?
 
user1182183
well @LucDanton is on his way to conquer the starred messages board, GL.
 
@Xeo Depends. Keep in mind BOOST_CONCEPT_USAGE was one. In fact right now I'm trying out a USAGE.
 
user1182183
4:42 PM
Luc, how long you've been away? Haven't seen you in a long time :P
 
No ellipsis conversion in constant expr, correct?
 
user1182183
@ScottW ;>
 
user image
2
this
 
> main.cpp|17 col 9 error| non-type template argument is not a constant expression
I suppose the base list is problematic then.
Same deal with alias template.
 
Xeo
Erm... hm
We might have a problem
 
4:46 PM
Go on.
 
Xeo
remove the .bar part
Oh, wait, I suck
 
@Xeo no! :(
 
Xeo
I should also invert the assertion conditions :D
 
@Xeo That is problematic.
 
Xeo
Yeah, nvm me :3
 
4:49 PM
Why can't I find boost::string_ref? They have to have such a thing right?
 
Don't think so. Especially considering they have ranges.
 
all I can find is that there's a mention that boost::asio has something with more or less the same functionality :/
@LucDanton yeah, I guess basically a string_ref is just a range....
 
Look for something like asio::buffer.
 
Xeo
Hm, I was about to commit the new makefiles, but then I remembered that I'd go home pretty soon too - so if something breaks, I'd be blamed tomorrow. :s
Welp, that has to wait till tomorrow then
Now that I think about it, I haven't been very productive today anyways...
 
4:51 PM
it was mostly hilarious
 
@Xeo Man, I was trying to make something like template<typename T> struct Barable: USAGE( /* test */ ) {}; work. I can't have SFINAE here so I have to think twice about what I really want.
 
Xeo
@LucDanton Heh
 
@Xeo Oh, sorry.
 
Xeo
@LucDanton Don't worry, it's only partly your fault. :P The other part was me finding an online demo of VVVVVV
 
@TonyTheLion I love the coffee made of snow. Disregarding the fact that it's clearly steaming.
 
Xeo
4:53 PM
Well, I did finish up the makefiles, so the day wasn't entirely nopping.
 
Naively what I can make work is a macro that expands into a tester overload set (with the lambda in it), and then a pseudo-concept-trait-thingy.
That's not composable though, i.e. it's one big concept in a go.
 
@DeadMG I know right, it's hilarity.
 
Btw I'm still amazed by that false : addr(/* whatever you want */) : nullptr trick. I've read the Pythy implementation when it was published but the genius of that bit only has hit me now.
 
another viewpoint
 
@DeadMG you can make hot drinks from snow
 
4:56 PM
wow
scons is magic
it works.
 
Xeo
@LucDanton Well, I do consider R. Smith a genius in a way. :)
 
@DeadMG that is how we live in America. Clearly you europeans do not understand our plight. I must go melt snow, and catch yummy birds.
 
> which will be eaten on Tuesday. They are yummy
 
@Xeo No doubt.
 

« first day (877 days earlier)      last day (4068 days later) »