« first day (1444 days earlier)      last day (3506 days later) » 

9:02 AM
@sehe oh...so I guess when they need sound effects of someone trying to speak while gagged in a movie, they give them the C std lib to read?
 
Does anyone here know if there exists a C++ proposal for constexpr argument overloads?
 
@melak47 That's one weird jump (from mbstowcs_s to standard library?)? But yeah, the C standard library would suffice too, I guess.
@Sofffia me neither. I think it's the most awesome if they expire, right? Mine have, long ago. But I don't have games so I just threw them away
 
9:17 AM
@sehe I think the joke is that the person didn't need the condoms because he was busy playing WoW.
 
I'm afraid you may be right. That said, there seems to be ample room for condoms now missing. You could just conclude that he didn't even need the DVD there and almost used all of the 24 condoms he originally had in there
 
Fair enough
 
(they don't go by 2 in my neighbourhood)
 
@sehe why? mbstowcs_s is a "secure" mbstowcs, which is from the C std lib?
 
Your question contains the answer.
Though you're also right that I didn't realize that these functions were standardized.
 
9:21 AM
I don't see why it's a weird jump from the secure possibly non standard function to the standard one :v
 
^^
 
If the proposal doesn't exist already I have a pretty cool idea.
My proposal is that you can make argument in a function constexpr that will only bind to constant expressions when called and will be a constant expression within the function. When there are two ambiguous compatible overloads and one is exactly the same as an other but with an extra constexpr argument, the one without is discarded.
 
@nightcracker What does this even mean?
 
@Rapptz See what I said like 1 second ago :P
 
Not getting it.
 
9:25 AM
Right now arguments to functions can never be constant expressions.
 
Are you looking for template integral parameters?
 
no
Accepting constant expressions as arguments.
 
Because they can be used at runtime
Your proposal makes no sense.
@nightcracker If it's constant expression, it can be in the template integral parameter.
 
@Rapptz But not if it's not an integral
 
I don't know the proper term for it
But anything that's a literal type can be there
 
9:26 AM
Let me sketch a few examples where this is useful.
std::pow(x, 2) could be optimized to x*x
by overloading std::pow where the exponent is a constant expression
 
that is a terrible example
 
You could do compile-time format string validation for format strings, because you can take constexpr string parameters
@Rapptz why?
 
the naive constexpr pow would blow through that
 
@Rapptz it can't, actually
In general, if you know something at compile time you can choose a better implementation or do some compile time checking but fall back to a runtime solution if you don't know the value at compile time.
 
just checked the assembly
it can
how can it not?
it's a terrible example
 
9:31 AM
that's for string literals
 
@Rapptz i think it's about seemlessly upgrading to compiletime processing in the case of constant arguments; IOW automatically templatizing the function on the argument lifting it to a constant template argument instead
@nightcracker if you consider the compiler may inline at it's own discretion, the compiler already has every freedom to do exactly this
 
@sehe If the implementation is source-identical.
 
@nightcracker wut?
Ah I get it. Pattern-matching on the value
 
@Rapptz Nah, ‘literal types’ is not a very useful notion. I don’t know of a catch-all for what makes a valid non-type argument, they’re all listed explicitly.
 
Hi
 
9:33 AM
It’s integral/enumeration types and addresses/references to SSDOs for the most part.
 
I thought it got extended in C++14
I guess not :/
 
Here's the thing
there's all kinds of uses for this
 
Google isn't talkative about SSDO
 
compile-time strings is one
and you can make hacky solutions for all of this
 
Static-storage duration objects.
 
9:34 AM
but this is a very natural extension that's general
 
compile-time strings are already possible
 
@LucDanton thank you.
 
not without changing syntax
 
not really
syntax is the same
unless I'm missing something
I even did it in C++11 so
 
It takes a (minor) hack, that's somewhat more involved than say a variadic indices trick AFAIR
 
9:36 AM
you could do string<N> that stores char data[N]; or string that stores const char* data; size_t len;
 
We get so used to workarounds in C++ we forget that they are workarounds
15
 
I didn't really feel like it was a workaround :(
What am I missing here
I think I'm missing something major
 
hold on
 
@Rapptz The concrete sample.
 
I'll try to construct an example
 
9:38 AM
Oh yeah, SSDO except that string literals are rejected. Because.
 
@nightcracker No, it's for numbers too bub.
 
@Rapptz I meant "string literals" as opposed to "strings in general"
 
what?
 
@LucDanton because folding/equivalence would be implementation defined
 
9:39 AM
That’s fine for a non-type template argument, it would be the address/reference to the character array.
 
But that would mean that X<"abba"> could be the same type as X<"abba"> or not depending on... the compiler
 
Yeah.
 
ok, if you overload them with sugar, espressos aren't really that bad
 
C++1z has std::string_literal<N> proposed.
 
woot
 
9:41 AM
Somehow, they have substr
 
Just TMP
 
I don't know how they plan on implementing that
 
I've seen a complete compile-time parser combinator in c++11: github.com/sabel83/mpllibs/tree/master/mpllibs/metaparse
 
I think all the regulars here have seen it :v
 
So, how could you wonder about implementing substr?
 
because
 
this is a random example
 
their string isn't string<N>
it's string<char...>
 
@sehe You can still do const char blah[] = "blah"; X<blah> {}; though. It’s the inconsistency I find silly.
"blah" refers to the same kind of object that blah is.
 
I think the issue with constexpr is that people seem to be unaware of the fact you can call these functions are runtime
 
9:47 AM
Here's the thing
 
@nightcracker I kinda 'get it' but I don't really like it.
 
Let's say you have two implementations for some function f
One is better if an argument of f is <10, but the other is better if the argument is >10
 
@LucDanton In this case the user spells out what char[] instance they're taking the address of.
Did the standard not define that the reference should be to a constant with external visibility?
(Otherwise I agree that now the inverse still exists: the compiler might fold different static const char[] objects even in the LTO phase, leading to new surprise)
 
However, at runtime it's not worth the time it costs to check if arg<10 to choose that more optimal implementation
 
@sehe Relaxed in C++11. Now it just needs linkage.
 
9:49 AM
but at compile time it is
 
@LucDanton Ah. So there's my mental mismatch. Thanks. So I agree that's half-assed then :/
 
then there's the entire "do extra sanity checks at compile time, but not at runtime"
 
I just don't see how this would work.
 
Come to think of it, I better check linkage of string literal arrays lol.
 
Knowing the standard committee, they'd make it a hint too.
just like inline
 
9:50 AM
And then there's functions that you only want to be able to run at compile time
 
@sehe meh, that's a very weird workaround for inline namespaces.
 
@Rapptz It's a set of library for meta-programming in C++. (metamonad and metaparse)
 
I don’t think it is specified. If it is, it’s not in 2.14.5 String literals. Oh well.
 
...?
 
@Rapptz have you ever worked with SIMD?
 
9:53 AM
I think you were supposed to look around in v1/.
 
or click any header..
 
reading this kit home construction manual is like reading ikea furniture assembly instruction - with a lot more tech jargons, in greater depth because the complications & 20 times longer ...
 
@Rapptz I don't get why you "meh" about something that is hardly relevant to that set of - awesome - libraries, even if they are mostly of academic interest.
 
I didn't say the entire library was 'meh'
I was commenting.
 
I linked to the project, that's all. I can't help you read half of the toplevel info there :)
 
9:54 AM
lol when I added a DVI cable to my order I didn't expect anything bad to happen
I might be getting my GPU a week later because the cable takes too long to arrive to the store from the supplier :\
wtf
 
what?
It's not hard to read
I'm just commenting on a single aspect about it
 
finally start digging next week! awesomeness ~_~
 
it made it annoying to navigate at first
 
@Rapptz It’s very Puppy-ish.
 
:D
 
user1804599
9:56 AM
ok
 
also I am ignorant to a lot of construction jargons ...
<- newblet
 
Xeo
Whee, getting my Fire TV next week.
 
Do you have insurance?
 
are you asking me?
 
user1804599
Wut, you can mute Twitter people now.
 
9:58 AM
kiss/mute
Tweetcaster had that feature long ago (called "Zip")
 
user1804599
How about not following them instead? :v
 
I have the general insurance for the land and the property in the front, but I have to buy extra construction insurance
 
@AlexM. what did you order?
 
a GTX 760, a DVI cable and an USB hub
the order is currently on hold because the DVI cable is on the way from the supplier
 
> buy insurance
apt, I suppose
 
9:59 AM
placing an order for the same DVI cable now means you'll be getting it on Friday
I ordered mine last Friday
 
user1804599
@sehe apt-get install insurance
 
I'm tempted to tell them to just drop the DVI cable and send me the rest of the order but meh
 
Of course. And you’d be ordering it again. It’s the same.
 
then I'd have to move my ass to the supermarket to get a cable
 
@rightfold apt-get source insurance;, hack hack debuild
 
10:00 AM
@AlexM. oh noo! :p
 
Single package to update since the last time is bash. Should I bother?
 
and now that my #niceBucketChallenge is over: I HATE YOU ALL KTHXBYE
@LucDanton lol
 
Xeo
@LucDanton oO
 
I even updated my overdue box with Ubuntu that ran out of security updates. Just compiled bash from GNU tar ball
 
guys
I heard all these terrible things happening with ISIS
 
10:02 AM
@melak47 meh I'll just wait, I told them to make sure it only arrives two days from now the earliest anyway
 
user1804599
Hash table bucket challenge.
9
 
I propose the ISIS bucket challenge
 
I just hope it will get here by the weekend
I want to play some games lol
 
@LucDanton even I heard about this, and I live under a rock :p
 
@nightcracker ISIS bullet challenge
 
user1804599
10:02 AM
I'm gonna make a tool that generates random wallpapers and installs them every ten minutes.
 
@melak47 hint: 97.39% says he was joking
@rightfold "install" a wallpaper. Wow. Also, this has surely never been done
 
I’m not esp. timely when it comes to updates and seeing the one package in the list was ominous.
 
@LucDanton It's worth it. Google the CVE (or "Shellshock")
 
user1804599
@sehe I don't care whether it has been done or not.
 
Naaaaaaaaah, I barely use it.
 
user1804599
10:04 AM
I want to make this goddamn tool and I want to make it in Perl.
 
@LucDanton cough. Irrelevant.
 
0
Q: How to correctly "perfect forward" getter functions?

Vittorio RomeoI'm creating a JSON library for C++14 and I'm trying to make use of move semantics whenver possible. My Value class has several setters and getters that always try to move when possible: template<class T> void setObj(T&& x) { type = Obj; hObj.init(forward<T>(x)); } template<class T> void setA...

 
Xeo
Luc Trollton?
 
Surely
 
user1804599
Lucky Luc
 
10:06 AM
 
user1804599
I should also make a tool that sets up a VM, a Git repository, a wiki and a YouTrack project with one button click.
 
Wait few years and I'll sell you mine
 
Those have been done, and abandoned I think
 
@Rapptz Isn't the ref qualifier necessary to decide whether to move or not?
 
time goes faster with coffee
why the hell did I waste my money on energy drinks
 
10:09 AM
@AndyProwl the member refs? Don't think so
 
espressos are 5 times cheaper and much better
 
@Rapptz why not? you need to know if the object is an rvalue in order to move from its member
 
@AndyProwl Yes, but notice the OP isn’t moving at all.
 
@0xmchow @matthew_d_green According to my scans, only 50% of systems have been patched for Heartbleed
 
@AndyProwl I'm talking about his specific case
they're useless there
 
10:10 AM
@LucDanton right, that's a mistake though
 
@sbi hey, you have like 2 data points for that :p
 
they don't do anything except code repetition
 
@Rapptz oh, I see
well
you don't know what's hObj etc
if they're pointer-like stuff, then yes it's useless
but if they are movable types, then the OP's question does make some sense
(except he's not moving from those members)
 
@melak47 so, were you there last tuesday? (or am I erring a week?)
 
@sehe you are. I hope. otherwise that makes 3 data points :p
 
10:12 AM
@sehe I wonder why people always come up with cool names for stuff like that
shellshock, heartbleed
hell, heartbleed even had this stylish logo and website
 
clearly they pay someone a lot of money for snazzy bug names
 
> hell
[sic]
I can name a few direct effects of good marketing. It's marketing after all
 
10:25 AM
@AlexM. Because it makes it easier to refer to than raw CVE number
And the rest makes for better news stories
 
journald and systemd; it looks as if Linux is becoming Windows, vindicating the way Windows do things
 
> using void = foo_type;
fuck
 
@VáclavZeman what
 
@LucDanton so much evil in the world
 
> Maybe it’s not required. I can’t tell.
:allears:
 
10:36 AM
@CatPlusPlus ..and you are deaf?
 
TIL this illegal:

`struct X { };`

`int main()`
`{`
` X const x;`
`}`
(fuck markdown)
 
@AndyProwl Because of uninitialized constant?
 
@VáclavZeman because X must have a user-provided constructor
(you cannot even = default it)
 
@AndyProwl Use four space indent?
testing
 
@VáclavZeman I tried that
 
10:40 AM
if you have multiple lines
then a button "fixed font" pops up on the right
 
message too old to be edited
 
that will
cause this
 
I think the problem is the "TIL this is illegal" line
 
How do I do multiple lines using the edit box?
 
struct X { };

int main()
{
    X const x;
}
 
10:41 AM
@VáclavZeman Could try shift+enter.
 
shit
 
(removed)
 
finally
anyway that thing is illegal
 
(removed)
 
GCC accepts it though
and of course so does VC12
 
10:42 AM
@thecoshman holy shit yes that sounds cool :D
 
morning girls
What's illegal?
oh that
 
you're illegal
(yep, that)
 
yeah there was a question about that a few weeks ago
 
@Rapptz I've been thinking a bit, and if you also make a constexpr qualifier on member functions, like void f() constexpr; to match a constexpr *this you can make std::string fully compile-time compatible without introducing a new type
 
let me see if I can find it, for no reason at all
whether*
 
10:44 AM
@AndyProwl woah andy, that's unlike you ...
what happened to those false sweetness? >_<
 
@LightnessRacesinOrbit which reminds me I should be on SO more often
 
@Rapptz and prevent memory allocation on constexpr std::strings's
 
@chmod711telkitty I'm not Andy. I killed him and hacked his account. Please don't reveal this.
6
 
2
A: The snippet shown below compiles in Coliru and Ideone, but according to iso § 8.5 p6 it shouldn't, or am I missing something?

Lightness Races in OrbitHaving studied the rules for initialisation and aggregates, I conclude that you're right — this is technically ill-formed. Your compiler is taking a shortcut because there are no members and thus no initialisation is practically required. (Funnily enough, the ancient GCC 4.1.2 rejects the progra...

lol, 3rd Jan, "a few weeks ago"
 
10:46 AM
time flies when you're wasting time
 
heh
@AndyProwl Yeah. It's all indented or none.
 
@LightnessRacesinOrbit +1ed, anyway looks like a duplicate of the Q&A you link in your answer
 
Is boost.org/doc/libs/1_56_0/doc/html/boost/interprocess/… the best way to know about existing instances of your application?
 
@R.MartinhoFernandes you're like the C++ guru around here right?
 
> As for why the standard doesn't allow this, well why should it? Empty classes are of next to no use
tag types
 
10:52 AM
@AndyProwl shhhhhh!
 
@Rapptz tag types != tag instances ?
 
tag types need an instance
 
oh right I'm retarded nvm
 
Technically it's not a duplicate, though it's close enough that I would have voted to close it as one had I not desired that sweet, sweet rep.
@Rapptz true.
 
Xeo
10:53 AM
> 2 upvotes
yeaaa...
 
"next to" ;)
 
Xeo
Well, 3 now
 
@Xeo Hey, that's 20 repz!
> A mutex with a global name, so it can be found from different processes. This mutex can't be placed in shared memory, and each process should have it's own named_mutex.
> it's own named_mutex
> it's
> it's
>.<
 
I do that all the time
 
Filing a bug.
 
10:54 AM
It's because I'm dutch
 
@nightcracker Er, what?
 
@nightcracker It's*
 
I do that all the time too
because I suck
 
@R.MartinhoFernandes I have an interesting C++ proposal but I'm wondering if it already exists
 
@nightcracker join the Asylum...
 
10:56 AM
@nightcracker run it by Vlad. if he thinks it's a good idea, don't submit it
@sehe omg so true
 
@LightnessRacesinOrbit lol
 
I want async functions in C++
what year will I get it
 
CTP has some support for them
good for playing around with them I guess
 
or am I missing something?
 
10:57 AM
not std::async
std::async sucks
 
@nightcracker he's referring to await
 
yeah
I don't know what the status on that is
All I remember was Nicolai Josuttis being emotional about it
 
0
Q: Chat transcript thinks I pinned a message. I didn't

Lightness Races in Orbit I'd starred this message, but now the message dropdown is suggesting that I also pinned it. In truth, not only is the message not pinned at all, but I'm not a room owner (sniff) so I couldn't make it so even if I wanted to (which I sorta do, come to think of it). I've done some digging and it ...

 
@Rapptz there is a quite elaborate proposal, but IIRC they are attempting supercool generalizations on which there is no consensus
 

« first day (1444 days earlier)      last day (3506 days later) »