« first day (815 days earlier)      last day (4359 days later) » 

07:07
@Rapptz Thanks :) Zoidberg suggested it btw.
yeah it helped me catch a very stupid bug..
@Rapptz Or the Length, squared. :3c
@Rapptz Looks good to me.
But, Can I do
Vector2D<float> xy(16, 19);
Vector2D<float> yy = xy.yy; // <--- { 19, 19 }

with that ?!
need braces
idk what .yy is though
07:18
If .yy was a vector then braces should invoke copy constructor IIRC.
It's also just a nicety. x3
I didn't add Swizzling.
I forgot it existed, now I remember that's what Xeo helped you with.. That I bookmarked and lost.. Stupid LWS archive wipe..
Also how would that syntax work in C++?
.yy would invoke a copy.
It would have to. But the idea is that 'yy' constructs a new vector that has both elements set to the 'y' alue of hte vector
yx would invert the values
ANd so on, so forth
for all possible combinations and permutations of {x, y}
( xx, xy, yx, yy : xy is already the standard though, so no reason to have it )
posted on January 08, 2013 by Scott Meyers

2013 is only a week old, and already there's been a lot of action on the C++ and Beyond front. That's especially the case if you're willing to fully embrace zero-based indexing (thus viewing December 31, 2012, as January 0, 2013), because that means that the following announcements have come out this year: There will be a 2013 edition of C++ and Beyond.  Tentative dates are December 8-11

07:35
Yay! I have created a new evil! Gotta balance out all the good code.
std::cout << 1.2_pnt + 56.89_pnt; -- (57,91)
dude that's cool
They plan their presentations a year in advance o.O
I don't know of any other way but decimal points. 1_2_pnt would call operator""(_2_pnt)
@chris warning: result of non-void expression --(57,91) ignored.
@chris Uhhh shouldn't it be std::cout << 1.02_pnt + 56.89_pnt; to equal (57.91) ?
07:39
@sehe, That's meant to be the output.
@Borgleader, It's an x,y point. I just parsed the string and separated the numbers surrounding the decimal into x and y.
@Borgleader if it as 1.20 maybe it'd make a difference
but how would that work out?
@chris Ohhh now I get it
Ewww
how can you have n%10 == 0 y points?
@chris You, sir, write too much SQL
@sehe, I might have written a couple practice SQL things, but nothing more than that.
07:41
ah man.. this made me laugh
I don't expect it to fly. It was just the notion of giving two inputs to the UDL.
@Rapptz that's a sad life attitude in my book
I guess a better example could've been std::cout << 1.56_add;, which would print 57.
you didn't answer how you deal with decimal points divisible by ten :(
@Rapptz, Oh, I don't. Wasn't important to the example, but I guess you could if you put enough effort into it.
07:44
@Rapptz IIRC you can just 'traverse' the characters as a char* in UDL functions
It'll treat 12.20 as 12 and 2.
@chris I know, that's why I asked :P
@sehe, I don't think you can for floating-point, can you?
template<char...> OutputType operator "" _tuffix();
Ooh...
@chris not completely sure. It could be surprising, but it could also be useful (think 010011010_b)
tuffix :)
Don't ask me. It was Wikipedia's.
I'll see if that works better for it.
07:46
Ah. then it's short for type suffix
@chris It does. It's also considerably harder to code.
@ThePhD That's dirty indeed. What's more amazing is, you found out :)
@ThePhD by the way, ping me when you get back.. wherever you are o.O
Xeo
Xeo
Mornin'
Xeo
Xeo
I just noticed I got a GeForce GTX 650 in my work PC. Nice.
Not bad.
Aha, finally.
It works with multiples of 10 now.
Took me long enough to get the stupid variadic stuff working. I was using <char head, char... tail> with a non-working base case, but I needed it to be <char head, char next, char... tail> and <char c> as my base case.
So basically, all I do is get a std::string by calling build<chars...>().
At least I'll easily know how to do it now if I actually need to.
@sehe, And only useful if we don't see the light of 0100_1001_1010b any time soon.
08:10
gcc has 0b prefix extension for binary :P
Interesting, never knew that. Does it happen to separate digit groups?
You could implement it for two groups with 15 different UDLs, but past 2 is unreasonable with that syntax.
I don't know if it'd be possible to use macros past 2 to scale it up.
Xeo
Xeo
@chris Which compiler?
@Xeo, I used GCC 4.7.2 for what I did. I'm just thinking in terms of standard C++.
Xeo
Xeo
Was the problem ambiguity with the overloads, or what?
@Xeo, For what? Making a temaplate<char...> into a string, or the binary literals?
Xeo
Xeo
08:15
> I was using <char head, char... tail> with a non-working base case, but I needed it to be <char head, char next, char... tail> and <char c> as my base case.
Oh, if I did a non-template build(), it said no matching function.
A <char c> build() was ambiguous with head being c and tail being empty.
Xeo
Xeo
@chris That actually shouldn't be.
I'm not sure why the first didn't work tbh. I don't know variadic templates as well as other things. I play around with them a lot to get stuff working.
Xeo
Xeo
Since the standard library itself should rely on non-variadic functions being partially ordered before variadic ones.
@chris Well, If you variadically expand and end up with build<empty_pack...>() (aka build<>()), it is forced to look for a template.
@Xeo, I figured that. I wasn't sure if it was possible to declare it as a parameterless template.
@Xeo, Here's if you're interested.
Yes, I could have just done head + build<tail...>() to avoid the extra string. That was kind of leftover from another try.
omg it's brilliant.
I can't complain, though. It was a nice exercise.
I think I saw that done with a vector or something not too long ago.
Xeo
Xeo
Well, your idea with char c and char head, char... tail should've worked.
So if that works, what difference does {(Cs)...} make?
Xeo
Xeo
I think in the current spec it's indeed ambiguous, but the standard relies on the ordering you expect with std::common_type.
@chris ... none?
morning all
08:26
@Xeo, I'm pretty sure (foo)... behaves differently than foo..., doesn't it?
Xeo
Xeo
If foo is an expression, maybe, but otherwise, no?
Darn it, I know there was a question on that exact topic.
Xeo
Xeo
Just what I wanted to mention.
Mornin' robot.
@chris: decltype(foo) and decltype((foo)) are different if foo names a variable.
Indeed they are :)
08:31
Mornin'
Fuck, dammit, if you heat up water, it is going to be fucking hot. Why can't I understand that.
A few tastebuds are gone.
Xeo
Xeo
lol
@Xeo, I remember a piece of what I was trying to remember. It had something to do with calling a function with each template argument instead of passing the whole parameter pack or something.
Xeo
Xeo
Are you thinking of foo... vs (foo...)? Otherwise, that still doesn't make sense.
@Pubby What the heck is that?
How does it know I am kind?
08:41
Mawning
@Xeo, Oh, I have it. Change foo(Cs...) to foo(cs)... and it works. liveworkspace.org/code/4lUMog%243
Xeo
Xeo
lol
That's what she said.
:P
Xeo
Xeo
Seriously, that's two completely different kinds of things.
hahahahahhaha
Well, I'm not too knowledgeable around variadic templates. You can see that. It was the combination of the function and initializer list, as opposed to either one by itself.
It's ok to suck :P
Can't get better without sucking.
Most of us here suck.
Though some canines are particularly adept at that.
Xeo
Xeo
08:47
lol
ow
Well, I can't believe I ended up spending so much time on the worthless 15.20_add thing.
@chris the quintessential question remaineth: does it work?
@sehe, It does.
08:49
great! that's good work
1 hour ago, by sehe
@chris It does. It's also considerably harder to code.
It wasn't bad after the variadic part.
That was just slightly annoying.
I forgot that you can't mess it up with letters or anything. I was going to just let it throw.
let it throw, let it throw, let it throw :)
(you know, the season's over)
@chris anyways, UDLs are constexpr because they should be compiletime
Oh, duh.
throw, throw, throw your boat?
Xeo
Xeo
@sehe Uhm, whut?
08:58
@sehe, It seems it's also possible to do them at runtime heh
Mine isn't constexpr-compatible.
@Xeo well, that's not true, indeed. It's what I expected
Xeo
Xeo
3
Q: Are user-defined-literals resolved at compile-time or runtime?

XeoI wonder, because predefined literals like ULL, f, etc. are obviously resolved at compile time. The standard (2.14.8 [lex.ext]) doesn't seem to define this, but it seems to tend towards runtime: [2.14.8 / 2] A user-defined-literal is treated as a call to a literal operator or literal operat...

:P
@chris Yeah I just noted that. Also, you have implemented it in a very painless way, I'd have gone for recursive variadic invocation with static parsing of the number, char_by_char
...
This should be known by now in this room but a function that is marked constexpr doesn't mean 'compile-time only' anyway.
Overengineering :)
09:00
@sehe, I did until Xeo put it in the initializer list.
user142019
Hello friends.
@LucDanton I know that. That was why I said it would be ... strange ... in a way to throw from a constexpr function - what would be the effect of throw in such a case? Fatal compilation error?
@chris o haha
@Zoidberg Go to your boring classes
user142019
@sehe Pas om drie o'clock.
@sehe It throws. Unless it doesn't.
i.e. please clarify the question.
@Zoidberg nice
09:01
@sehe Not unless it was used in a context that requires a constant expression.
@LucDanton I mean, does it prevent static evaluation if there is a throw clause?
Otherwise it works just fine.
user142019
@sehe No, it's not nice. I'd rather have it right now so I can spend the rest of my time with something useful.
@sehe Yes, no UB. Must be diagnosed.
user142019
Aka testing the stack unwinder I just implemented.
09:02
Gah, up to CTFE or whatever it's called, that is.
user142019
This is awesome, by the way. projects.haykranen.nl/java
@Zoidberg You still can. Technically, the rest of your time is equal. Logically, you have more "untainted" time now, since you haven't been 'harmed' by the boring class yet
11
A: Is it legal to use side-effects in exceptions thrown by constexpr?

R. Martinho FernandesIt is legal. For each constexpr function there must be some argument values that result in a constant expression (§7.1.5/5): For a constexpr function, if no function argument values exist such that the function invocation substitution would produce a constant expression (5.19), the progr...

Function invocation substitution.
user142019
@sehe Well, that is true, but now I will be interrupted by the terrible lecture.
09:03
:7067457 well. duh. life will be interrupted
Xeo
Xeo
Guys
Why would this work, but this not? The only thing I changed is the void(&T::f) in the second link.
user142019
> error: 'case' statement not in switch statement
user142019
Damn. I have a syntax error in C++. How is it possible? Such a nice language with such an easy and simple syntax.
@Xeo Erm, is that a trick question?
Xeo
Xeo
@R.MartinhoFernandes I'm honestly curious.
09:06
You should sleep.
Xeo
Xeo
I'm not sleep-deprived, but I must obviously be overlooking something.
C'mon, tell me.
@Xeo You appear to be trying to cast a pointer-to-member-function to void.
Xeo
Xeo
@AndreiTita You can construct a void "value" from anything.
user142019
Should I use = boost::none_t{} instead of .reset() on a boost::optional? .reset() is deprecated.
@Xeo Compiler is the crazies, tis all.
Xeo
Xeo
09:11
Oh
@Zoidberg No
You should use = boost::none :P
Saves 4 key-strokes.
It appears you can put any crap you want in the void.
user142019
@Xeo So this exists...
user142019
I have used boost::none_t{} for ages. xD
@Zoidberg What Xeo said, but yeah, that is the alternative.
@Zoidberg Oh gawd, the suckage.
Xeo
Xeo
@Zoidberg You suck.
user142019
09:12
I'm a fucking noob. Except I never fuck.
Xeo
Xeo
room topic changed to Lounge<C++>: You suck. [c++] [c++11] [c++-faq]
@R.MartinhoFernandes commonly referred to as the cloud
@R.MartinhoFernandes how so? attention deficit?
@Zoidberg When did you stop? You stopped since you became 18? Now it's legal so it's no fun anymore?
user142019
I'm going to start a cloud hosting company called /dev/null Cloud Hosting. Storage will be very cheap for me, but I don't guarantee your data will be safe. Luckily, nobody reads the Terms.
You will also beg for sandwiches in the streets.
user142019
09:15
lol
I'd like them to make a James Bond prequel where he only has a provisional licence to kill, and M has to hold the gun at the same time.
@Zoidberg I'd add the service to encrypt the data free of charge. I.e., writing to /dev/null, reading from /dev/urandom
Xeo
Xeo
lol
user142019
@sehe lol
user142019
I wrote a stack unwinder in the train. :3
user142019
09:16
In Zoidlang, opcode 42 is throw exception. xd
@Zoidberg Actually, that is considerably more expensive to host, but the reward conditioning is all nicely worked out so that people won't abuse their fair-use terms (too much)
@Zoidberg No hex jokes... Makes me sad. I liked things like 0xEIEI0
@R.MartinhoFernandes void* crap = &any_crap;
user142019
@sehe No I just categorize the opcodes and number them decimally.
@Zoidberg Boring
user142019
NOP is 0, POP is 10, JUMP is 20, CALL is 21, RET is 22, OBJ_GET is 30, OBJ_SET is 31, OBJ_UNSET is 32, SET_EXCEPTION_HANDLER is 40, UNSET_EXCEPTION_HANDLER is 41, THROW is 42, etc...
user142019
09:18
I should use hexadecimals indeed.
And another VS crash trying to even invoke the Profiler wizard again in VS2010. This is after a full git checkout HEAD~3; git clean -dfx; iisreset and reopening the solution
Something is fundamentally broken there. I hope I'm not going to have to reboot again. That would take 20 minutes
I think I'm in over my head trying to make my adding literal into a constexpr.
user142019
@sehe s/Something/Everything/
Obviously
user142019
I throw an exception if the thrown exception is not handled.
@Zoidberg how meta
user142019
@LuchianGrigore I cannot delete answers, so downvote from me.
user142019
(I didn't even read it.)
(cough)
user142019
(Now I did, and the answer is so terrible it shouldn't be deleted but instead downvoted into oblivion.)
09:23
BURNINATED
Xeo
Xeo
Oh my. Remember the Singleton template with a virtual destructor? I just noticed the destructor is actually protected.
THE FUCK
@Xeo Makes sense, right. No one deletes it but the offspring of this mutant
user142019
Protected dtor. Wat.
Xeo
Xeo
@Zoidberg That part makes sense.
A public virtual dtor might make sense too.
But not a protected virtual dtor.
What's so strange. Only friends should be able to call delete on the instance...
user142019
09:25
Or you know, just don't implement a singleton template.
user142019
> The singleton pattern is bad and you should feel bad.
Xeo
Xeo
@Zoidberg Well, aside from that obvious problem.
user142019
:P
user142019
Wait, a protected virtual dtor. Wat.
user142019
That makes no sense. WTF.
Xeo
Xeo
09:26
Isn't that what I just said?
@Xeo Perhaps they register singletons in a global SingletonInstanceRegistry friend class. And that registry is doing the cleanup of instances. Or something :)
Xeo
Xeo
@sehe Nah. But they do manually create and destroy the singleton... no lazy-init. :|
user142019
In Spring framework the logger sometimes says "creating singletons" and "destroying singletons".
@Xeo That in your code?
user142019
It's terrible and broken and everything is fucked-up and oh God why does it even exist.
Xeo
Xeo
@R.MartinhoFernandes Company code.
user142019
Your company is bad and it should feel bad.
Bad company.
user142019
std::stack y u no swap top two objects function.
@Xeo No pattern of the Sfinx either then
Xeo
Xeo
09:36
@StackedCrooked Atleast it's 3-4 year old code, when they just started out - it's their oldest project.
@Zoidberg nice. it's probably instantiating the logger singletons and logging after/before the fact :)
user142019
BUT WHAT ABOUT THE LOGGER SINGLETON
user142019
Maybe they have a separate logger singleton to log that.
@Zoidberg because that's not exactly LIFO.
user142019
Meh.
user142019
09:37
auto* a = data_stack.top();
data_stack.pop();
auto* b = data_stack.top();
data_stack.pop();
data_stack.push(a);
data_stack.push(b);
user142019
Like that, right?
Xeo
Xeo
Think so.
user142019
Aight.
@Zoidberg fuck logger singletons
also hi
user142019
fuck singletons FTFY
Xeo
Xeo
09:41
Jan 4 at 14:21, by StackedCrooked
Lol, I found this in jalfs code: auto& mgr = stm::frontend::get_manager();
Hi. :)
@Xeo shush you :)
user142019
You work at the same company?
Xeo
Xeo
lol, no
user142019
oh dx
Xeo
Xeo
ah... I know this code is C++03, but manual new/delete... I hope we can upgrade to GCC 4.7 on the build-server soon.
If we have that, we can get VS2012, and roll from there.
Or just stay with VS2010.
09:45
@Zoidberg nah, it's the code from my old masters thesis (plus some improvements I've made since then)
user142019
oh cool
yeah, I just wish I'd had time to get rid of/rename that manager class ;)
@Xeo We now have a weapon to silence @jalf at any time :P
and do about 200 other fixes and improvements ;)
@StackedCrooked on the contrary, any time you bring it up I have to talk enough to drown it out again ;)
Smooth talkin heh.
09:48
Coding with XCode and Objective-c feels stupid like coding a website with DreamWeaver...
user142019
lol
user142019
Use Vim.
user142019
Also capitalization fail.
ah, this is just great. Got like 7 hours to kill in Warsaw airport...
@jalf The not-so-fun aspect of travelling.
Xeo
Xeo
09:49
Meh, I want the multi-screen support from VS'12 in VS'10 :(
"Place dat over there", "Link that action with that", "Put two lines of code there" and et voilà: a working login screen. That's not coding! Where's the fun? Where's your coding style? Where is your crappy class organization?
Now I get why there are so many apps and so few real developers.
@StackedCrooked indeed
Feels extra stupid because we practically flew over Copenhagen on the way here. Now I have to wait 7 hours for a plane going back so I can get home
Xeo
Xeo
@StackedCrooked Not if you got a laptop and a shitton of youtube subs to catch up with! :D
@jalf ow
@Zoidberg, I don't think you are even allowed to use anything other than xcode to make apps...
user142019
Of course you are, you fool.
09:53
guys
user142019
You can use any tools you want as long as you sign the code and it fits the requirements.
@Zoidberg Are you ...Mr T?
@Xeo you know, they should really work on the ability to just airdrop passengers without landing :)
user142019
No, I'm mister Z.
would've saved me the better part of a day
Xeo
Xeo
09:55
@jalf Free skydiving for 1 person per flight?
Xeo
Xeo
That would roughly double the ticket-price, is my guess, though. :P
user142019
You don't learn a language without using it.
> straight Objective-C
I giggled
user142019
It you think otherwise, you're a fool.
09:56
@Xeo that's why they need to work on the technology :D
Xeo
Xeo
@jalf Well, as long as you don't expect any guarantees, the current technology for dropping you out of a plane works fine...
@NolwennLeGuen, has it something to do with some old apple-gay jokes?
@Jeffrey Absolutely!! I'm glad you got it
Xeo
Xeo
Oh well, atleast he codebase is const-correct. I'm happy about that.
@Zoidberg "Xcode is very useful even if you are not making GUI apps. Only a complete masochist would prefer to use a text editor and manual invocation of the command-line compiling and linking tools."
user142019
09:59
That's not true.
user142019
A masochist would use Objective-C without code completion.
user142019
And many tools have that.
user142019
Such as Vim and Sublime Text 2, which can use clang for that, just like Xcode does.
@Zoidberg, I was just pointing out how badly most of the xcode users think.

« first day (815 days earlier)      last day (4359 days later) »