« first day (838 days earlier)      last day (4109 days later) » 

3:00 PM
Meh, that's still bad. I guess I could wrap them in a new type FooWrapper = FooWrapper Foo or something but that is annoying
 
View patterns can do that I think
You still need id with concrete type though
 
I'll look into view patterns
 
@CatPlusPlus I think you still need to _ all the members.
It's just exp -> pattern.
@CatPlusPlus Not it.
 
Not it what
 
4 mins ago, by Pubby
Except I need to have separate overloads for the various constructors
 
3:03 PM
 
@DeadMG lol
Took me a while to notice the underscore.
 
Right
 
I thought it was a halo.
 
heh
 
I guess it's silly anyway in this simpler case
Derp
Nevermind
 
3:04 PM
@Zoidberg Also try /sbin/ifconfig.. on debian anyway, /sbin won't be in your path by default unless you're root.
 
What would be the proper data type for the number 600851475143 ?
 
Verbing _ didn't feel wrong. I'm I evil?
 
@Crowz FILE*
 
Oh hey, I found it
foo x@(A {}) = ...
foo x@(B {}) = ...
@Pubby
 
3:11 PM
I just learned about that syntax to construct with (recent question). Makes sense that it's available as well to deconstruct with.
 
user142019
@Collin I don't use Debian.
 
user142019
It's terrible.
 
Use Windows Vista for a year and you'll suddenly find that Debian is a very pleasant alternative.
 
user142019
Comparing terrible software to other terrible software is quite pointless.
 
fuck, we have C++ training in the upcoming week, but all the seats are taken already -.-
 
3:15 PM
Who were you going to train?
 
user142019
So you'll have to stand.
 
How is 600851475143 out of the range of double? Isn't double 64-bit?
 
user142019
Do you want to represent an integer or a floating point number?
 
@R.MartinhoFernandes :)
 
user142019
If you want an arbitrary precision integer, use Integer.
 
3:17 PM
All aboard the C++ train, next stop is: undefined.
4
 
@CatPlusPlus Put some punctuation and I'll star it.
 
@Crowz Can go up to 10^300 on most implementations.
 
Punctuation is for weak
 
user142019
Sounds more like JavaScript.
 
3:18 PM
@CatPlusPlus You did it.
 
@Crowz 64 bit is quite a lot
 
I'm weak
5
But for stars
Different thing
 
@BartekBanachewicz Yes, but my thing is saying 600851475143 is out of the range of a double data type
 
user142019
HASKSKELL
 
Hello, friendly woodland creatures.
 
3:19 PM
@Crowz your thing is wrong
 
Oh der.
 
(And friendly robot)
 
it's in range
 
If I put a .0 after it, it'll work
 
user142019
awoodland
 
3:19 PM
you mean it's out of range of an integer
:-)
 
user142019
@Crowz that's because 600851475143 is an int and 600851475143.0 is a double, obviously.
 
user142019
Also.
 
@Crowz You are doing it wrong.
 
user142019
Decent compiler warns on overflowing constant.
 
It works for me without .0
 
3:21 PM
I declared it as a double like
double number=600851475143;
findLargestPrime(number);
 
@Crowz so you are trying to put an integer to double. wrong.
 
user142019
@Crowz So what? 600851475143 is still an int.
 
You are doing it wrong.
@Zoidberg Irrelevant. (and isn't)
 
3:21 PM
Ah that's weird. I like how python can do this stuff easily.
 
user142019
The compiler doesn't give a fuck about you assigning it to a double.
 
@Zoidberg It does.
 
@Crowz I like how you can't code in C++.
 
user142019
@Crowz Yeah but Python doesn't suck as much as C++.
 
@BartekBanachewicz I'm trying to learn D: That's why project Euler
 
3:22 PM
hello
 
user142019
goodbye
 
@Crowz Solving project Euler isn't the best way to learn D.
 
I have a problem when converting int to std::string in c++. I am using boost threads and there seems to be problem with sstream or boost::lexical_cast due to the "local".
 
@Renaud std::stringstream?
 
user142019
3:24 PM
Use Erlang or Haskell and problem solved.
 
Xeo
@R.MartinhoFernandes Wait, you're using not now too?
 
@Crowz What does findLargestPrime do?
@Xeo It makes the assertion stronger.
 
with std::ostringstream there is no problem of local ?
 
user142019
It finds the largest prime.
 
@R.MartinhoFernandes let me guess... finds largest prime
 
3:25 PM
Or maybe not
 
It probably casts the double back to an int or something.
 
user142019
@BartekBanachewicz Stack Overflow FTFY
 
I don't think boost lexical_cast uses shared state.
 
user142019
What about all that locale crap? Or isn't that global?
 
3:26 PM
@R.MartinhoFernandes projecteuler.net/problem=3
 
@Xeo I always use not in static_asserts like this. I don't want someone to miss it and reply "that proves my point".
@Crowz I don't see that function there.
 
Xeo
@R.MartinhoFernandes I see
 
@R.MartinhoFernandes Well it just finds the largest divisible prime. It's not working right now apparently
 
@Crowz Right. And that's why I asked...
And I can read the function name, btw.
 
user142019
3:27 PM
Me too.
 
I'm not sure why that wasn't assumed.
@Xeo So in a sense, it does make the assertion stronger :P
 
Xeo
@R.MartinhoFernandes I actually use == false for that specifically, since the ! would be so far removed from the actual value access otherwise (considering that static assert checks are rather lengthy most of the time).
 
@Xeo I should stop using ::value anyway.
 
what's wrong with ::value?
 
() is the way to go.
 
3:30 PM
@Zoidberg Yes and no. There is a global locale that's used to initialize the locale object the std::stringstream will use, but that's about it -- as it's using it, it uses a local copy, not the global locale itself.
 
@R.MartinhoFernandes As in, make it lambda-compatible?
 
Xeo
@R.MartinhoFernandes Yeah, but only if you have constexpr. :(
 
Xeo
@R.MartinhoFernandes You can't use a true_type() if there is no constexpr conversion operator.
 
Strange, I never knew it defined ().
That's good to know.
 
3:31 PM
ugh, git submodules are weeeeird
 
Xeo
@ThePhD It's a type, an object is created by the (). Also, {}.
 
Ah.
 
@Xeo WTF do you mean? There is one.
 
And it gets down-converted
 
It's mandated.
std::true_type() is the same as true unless your implementation is broken.
 
3:32 PM
@R.MartinhoFernandes Good point, much less noise.
 
Xeo
@R.MartinhoFernandes Okay, tell me again, which compiler doesn't have constexpr? See? Thank you.
 
I think I'm going to have to start using globals or something. =[
 
@Xeo Oh, that...
Sigh.
 
@Xeo MSVC! :D
Do I get a prize?
 
I want alias templates before constexpr
 
3:34 PM
@Xeo I actually prefer it to look like a function call instead of an instance creation.
 
We should have thought of that when there was that 'traits as constexpr functions' vs 'traits as metafunctions' thing going on!
 
Xeo
@LucDanton Erm, didn't I say that there's the conversion op?
 
I don't remember, so no.
 
I'm soooo good.
 
3:38 PM
@EtiennedeMartel when?
 
9
A: Why are type_traits implemented with specialized template structs instead of constexpr?

R. Martinho FernandesOne reason is that constexpr functions can't provide a nested type member, which is useful in some meta-programming situations. To make it clear, I'm not talking only of transformation traits (like make_unsigned) that produce types and obviously can't be made constexpr functions. All type traits...

I updated my answer.
 
@EtiennedeMartel I took my painkillers. I feel like House xD
 
Xeo
@R.MartinhoFernandes I'm kinda surprised it isn't explicit.
 
template <typename T> enable_if<is_void<T>(), int> f(); I <3 it
 
Xeo
3:44 PM
You ♥ it.
 
No you're not.
 
Xeo
You suck.
 
yo fucking lo
 
@LightnessRacesinOrbit You're quite the Swagda McYolo this morning aren't you...
 
@Borgleader except it's not morning
 
3:54 PM
@LightnessRacesinOrbit It is for me.
 
@Borgleader I don't care
 
I reject your reality and substitute my own :)
 
anyway for some reason I thought you were Swedish
 
LOL
Nope, French Canadian
 
3:55 PM
The worst kind of Swedish ever.
@Borgleader Btw, since you're here... "Défense de fumer" is "smoking prohibited"?
 
@R.MartinhoFernandes Yeah
 
going for a nap
 
Xeo
0
Q: Pass this as smart pointer to constructor of base class

hpohlI've implemented my own smart-pointer using reference counting. A smart-pointer is called Ref<T>. There is also the equivalent to std::enable_shared_from_thisnamed Ref<T>::NoParentOnly. Ref<T>::Only<Parent> can be used when deriving from a class which has already inherited...

This is horrible.
 
@R.MartinhoFernandes Yes.
 
@R.MartinhoFernandes You lost your way and ended up in France?
 
@R.MartinhoFernandes that's a not a dong
 
@R.MartinhoFernandes let's just say, I am sure tony will turn up soon :P
 
4:08 PM
Hmm, there's a monospaced variant of Arial.
Nevermind, it sucks.
 
@R.MartinhoFernandes there is a monospaced variant of most fonts, they almost always suck
 
@thecoshman No, there isn't. At least not actually designed.
 
@thecoshman I'm here
 
@R.MartinhoFernandes Here, I heard your silent cry for attention :)
 
void factorial(int n, function<void (int)> k) {
 cps2(equal_to<int>(), 0, n,
  [&](bool b){cps_ifthen(b,
   [&](){k(1);},
   [&](){cps2(minus<int>(), n, 1,
    [&](int nm1){factorial(nm1,
     [&](int f){cps2(multiplies<int>(), n, f, k);});});});});
}
 
Xeo
4:14 PM
@sehe Sometimes, I feel like writing lisp when I count the ) I need to type. :( And then I get something like )))); at the end of the line.
 
@R.MartinhoFernandes no I mean crappy 'we made a nice font, let us make a monospaced variant of it'
 
kill it
with fire
 
@Xeo "I feel like writing lisp" may not mean what you think it does
 
@Xeo Your editor should help you with that to some extent :| Just like it should when using a lisp.
 
4:16 PM
@sehe Oh gawd.
Whyyyyyyyyyyyyyyyyyyyyy.
 
@LucDanton yeah, I don't mind the parens. Pretty unavoidable in C-like languages
@R.MartinhoFernandes Becoz! You should know what it is like. Anyways, the way I remember it's not nearly as bad as that article I remember from Pubby. What was it again
 
Something about metafunctions?
Composing them another way for better performance?
 
s/*OPEN*/(/g
s/*CLOSE*/)/g
a very crap solution, but it might just work :P
 
@LucDanton Frankly I hate the mixture of braces a lot more:
std::foreach(std::begin(container), std::end(container),
     [](decltype(X<T>::template get<0>());
 
grep sez I don't have any }) deeper than one, but I may have botched that.
 
4:20 PM
@LucDanton You have likely
@LucDanton Post the regex?
 
\(})\s*\)\{2,\}
Perhaps there's a better class than \s?
 
Morning
 
@LucDanton you mean, [:bacon:]?
 
Do I? I've just eaten some delicious spaghetti.
 
@sehe Why does everyone in there have a furry or dragon avatar?
 
4:23 PM
 
@Rapptz why do you ask me?
@LucDanton erm. my grep -E doesn't like it. Did you use something funky with that?
 
I don't know. Good question.
 
@sehe No -E. Also quoted.
 
@Rapptz except we don't
 
@LucDanton Doesn't work here (GNU grep). Anyways, it did with -G instead:
./unit/recursive_variant.cpp:}) })
 
4:25 PM
@thecoshman "we"?
 
@Rapptz we don't all
of the sub set that do, we all do
 
@sehe How disappointing, the braces are from uniform initialization.
 
but as the collective whole, we do not all
any hoops
home time me, suckers!
 
@LucDanton irrelevant
 
I wasn't talking about the Lounge.
I was talking about the comments on the page sehe linked.
 
4:26 PM
@LucDanton The regex doesn't match at all for wheels
 
Plus, it's a unit test!
//struct{}_=stored_type{};
Remnants of a small skirmish against the compiler. I won.
 
@R.MartinhoFernandes: Write moar blog posts.
 
@Borgleader Quality over quantity.
 
@Rapptz But I must acquire knowledge.
 
Read answers on SO.
A lot of them are actually pretty good.
 
4:31 PM
I wish there was a "Day9 Daily - Learn to be a better gamer" but for C++. It would be called "Robot Daily - Learn to be a better programmer"
Meh answers on SO don't help me understand concepts. It's more like "fun facts".
 
I think you don't browse well enough. :P
try the tag
 
Aaaand we have the fail whale
 
user142019
@sehe What the GUI?
 
user142019
Oh Opera, right.
 
user142019
The forgotten web browser.
 
Are RNG distributions expensive objects? Why have them be objects at all?
 
Uh, Twitter doesn't onebox anymore?
 
http://twitter.com/ericlippert/status/297013009363111936
 
user142019
@EtiennedeMartel probably because it's borked.
 
@EtiennedeMartel twitter is having issues.
 
4:38 PM
"Is C/C++ one language or two languages?" -> It's a federation of languages (Scott Meyers, Effective C++)
 
user142019
C/C++ is ++.
 
user142019
Like 2/2a is a.
 
@Rapptz I can access Twitter on my end.
 
user142019
@EtiennedeMartel Try rebooting and see if it helps. Oh wait.
 
Ah, no longer.
 
Xeo
4:39 PM
@Pubby Maybe they need state?
 
WELL, WELL
 
@Zoidberg The only thing you forget
 
There, I managed to do a last-second edit.
 
user142019
@sehe :P
 
@Xeo I guess. The new RNG seems much more verbose. I miss rand().
 
4:40 PM
@Pubby Miss Randy. Now there's an introduction that will perk some ears. "Hi, everyone, meet Ms. Randy"
 
user142019
@sehe Remembers me of me once saying here that I remembered a lot; e.g. about the teacher in my final year in basisschool losing his agenda.
 
Xeo
@Pubby It's also much much more powerful.
And it's not that verbose.
 
@Zoidberg Not just that. I'm not blind. It's about all the details of languages that you sseem to be able to remember and keep separate. And API's. And bugs. And trivia.
 
user142019
That's because I use a lot of languages.
 
@Zoidberg s/Remembers/reminds/?
 
4:42 PM
@Xeo Nothing will ever be as verbose as chrono.
 
user142019
@sehe ~english~
 
@Zoidberg Sane normal people would mix them up
 
user142019
DUTCH FTW
 
user142019
@sehe they're inferior.
 
user142019
 
4:43 PM
@Zoidberg "Onthoudt me dat ik eens heb gezegd" would be equally ... awkward
 
user142019
Oh gawd Apple y u Comic Sans as example.
 
user142019
@sehe Herinnert me aan
 
@Zoidberg Helvetica, Courier, Arial, Comic S., Times N. Roman?
 
user142019
@sehe The latter is not Times New Roman. It doesn’t even come close.
 
@sehe Isn't Arial a poor man's Helvetica?
 
user142019
4:44 PM
I like Palatino.
 
@Zoidberg "Does remind me of", "Makes me think back to", "Brings back echoes", (reminiscence, recollection, harken, etc. also could be used to convey similar vein)
 
user142019
Typography y u so complicated.
 
user142019
> Characters and glyphs do not have a one-to-one correspondence. In some cases a character may be represented by multiple glyphs, such as an “é” which may be an “e” glyph combined with an acute accent glyph “´”. In other cases, a single glyph may represent multiple characters, as in the case of a ligature, or joined letter.
 
@Zoidberg It's an italicized font with 'schreef' (what's that again).
 
user142019
@sehe serif?
 
4:45 PM
@Zoidberg serif indeed.
 
user142019
 
user142019
Those red things are serifs.
 
user142019
There's also slabs, which are similar.
 
@Zoidberg I knew what I meant, thank you
 
user142019
No problem.
 
Ell
4:46 PM
why is typography complicated?
monospace fonts, serif/sans serif
what else is there to it?
why is typography complicated?
 
cough
 
user142019
@Ell ligatures, for example.
 
It's just a subject with a lot of tradition. Is all
 
How else would designers have more fun?
 
user142019
It’s not just about categorizing fonts.
 
4:48 PM
@Rapptz By screwing around
@Zoidberg That'd be fontography / fontology
 
user142019
Also
 
user142019
 
user142019
Just to give some examples. :)
 
is there anything in Boost::Filesystem that can strip illegal characters from filenames? there are a bunch of name_check functions that will tell me if a string contains illegal characters, but I don't want to package each char into a string so I can use that with remove_if or something ._.
 
@Zoidberg NOT SURE IF BOW TIE UNDONE OR ASYMMETRIC MOUSTACHE
 
user142019
4:50 PM
And kerning aka keming.
 
@melak47 No
 
@sehe It's a regular tie on someone's face.
 
@Zoidberg Well, that's easier than the HTML/CSS box model
yesterday, by sehe
@Xeo You need better font or keming
 
user142019
Alignment; especially justification. And hyphenation.
 
user142019
4:51 PM
@sehe always use the alternative (non-default) one, don’t know what it’s called.
 
user142019
The default one is terrible and makes no sense.
 
Dehydration and hyperventilation
 
@melak47 Strip \/:*?"<>|
 
yeah. bleh
 
@melak47 There is room for a nice Monte Carlo algorithm to do this!
Get writing!
 
user142019
4:53 PM
Oh gawd. Complicated class hierarchy.
 
@sehe monte carlo algorithm for removing characters? O_o
 
std::remove_copy_if(
    filename.begin(), filename.end(), std::back_inserter(sanitized),
    [](char x) { return std::string("\\/:*?\"<>|").find(x) != std::string::npos; }
);
 
user142019
lol NSFontManager.
 
God my laptop is fucking slow
 
@CatPlusPlus yay, I don't need to do it myself ^_^
 
Xeo
4:54 PM
@CatPlusPlus But but regex!
 
Fuck regex
 
Xeo
@CatPlusPlus Insert it into filename itself?
 
user142019
Y U NO RAW STRING LITERAL
 
user142019
ALL THOSE BACKSLASHES
 
Xeo
@Zoidberg > ALL
> 1
 
user142019
4:54 PM
Two.
 
Xeo
Oh, right.
 
Who cares
 
> Note: Reserved device names are not valid as file names, but are not being detected because they are still valid as a path. Specifically, CON, PRN, AUX, CLOCK$, NUL, COM[1-9], LPT[1-9], and these names followed by an extension (for example, NUL.tx7).
 
user142019
See? Unreadable. :P
 
Here's a question... for finding the largest prime...
 
4:55 PM
 
@melak47 yeah, just randomly remove certain characters until check_name returns true
 
@Xeo And that would work how
 
user142019
@Crowz Use Wolfram Alpha. PROBLEM SOLVED.
 
@sehe that's what I thought >_>
 
4:55 PM
@Crowz largest prime for what?
 
problem is it won't converge on the correct solution, but on a correct solution :/
 
The largest prime
 
Could you fill an array from 0 to the number, and then iterate through by certain increments and remove things such that only the primes remain?
 
Xeo
@CatPlusPlus erase-remove! :D
 
@CatPlusPlus I really wonder how far this will be optimized (assuming SSO doesn't kick in)
@melak47 Also
 
4:56 PM
@Xeo Yeah that's much better
 
@Crowz Yes..? It's called a Sieve of Eratosthenes or Atkins
 
@sehe vOv who cares
 
@sehe yes?
 
kind of like an array to the number 10, [1 2 3 null 5 null 7 null null null] ?
 
It's not something used often enough to matter
 
4:57 PM
@Crowz ew ew ew
 
@Rapptz what the hell is a "sieve"?
 
@Crowz waste of space
 
@melak47 Lag. That was typed before the previous quote
 
@Crowz Why don't you google these things?
 
4:57 PM
And wherever you use it, you're doing I/O anyway
 
@sehe oh.
 
@Rapptz Google has him question banned, I think
 
lol
 
lol
 
@Rapptz I'd rather not read ridiculous mathy definitions of silly things "let x be y such that q is a panda and w is muh dick"
 
4:59 PM
lolbru
 
?_?
There is literally pseudocode in the Wikipedia article
If you would google it.
 
Too pseudo
Send me teh codzez
 
@Rapptz But google failed to provide a pseudo-compiler. Is it commercial only?
 
@Rapptz Because that would require doing something.
 

« first day (838 days earlier)      last day (4109 days later) »