« first day (639 days earlier)      last day (4308 days later) » 

6:00 PM
@FredOverflow yes, I liked it
 
@rubenvb it's like a librarian
 
Libertarianism refers to the group of political philosophies that emphasize freedom, liberty, and voluntary association. There is no general consensus among scholars on the precise definition. Libertarians generally advocate a society with a government of small scope relative to most present day societies or no government whatsoever. The Stanford Encyclopedia of Philosophy defines libertarianism as the moral view that agents initially fully own themselves and have certain moral powers to acquire property rights in external things. Libertarian historian George Woodcock defines libertarian...
 
@rubenvb it's Anarchy, but with police.
 
Anarcho-capitalists. More or less.
 
hmmm. To the gas chambers!
 
6:01 PM
In practice, it's mostly rich people who don't want to pay taxes.
 
@rubenvb San Quentin no longer delivers. :(
 
Because taxes harm their FREEEDOOOOOM.
 
@EtiennedeMartel do they ever actively protest?
I wonder how they get to the location if they do; public transport is paid by taxes (largely)
 
@rubenvb yes, they do
 
Xeo
5
Q: Implicitly treating returned lvalue as rvalue

FredOverflow12.8 Copying and moving class objects [class.copy] §31 and §32 say: in a return statement in a function with a class return type, when the expression is the name of a non-volatile automatic object (other than a function or catch-clause parameter) with the same cv-unqualified type as the funct...

 
6:05 PM
@rubenvb same way as everyone else.
 
Is this indentation too messy? What do you guys think?
http://ideone.com/8iHTX
 
Xeo
Anybody got Clang handy?
 
One thing I don't get is... Someone gets sentenced to death and then waits over 20+ years to actually be executed, sometimes dying of natural causes. What's up with that?
 
@ManofOneWay it's not my favorite, but it's good enough
 
@Xeo waddayaneed?
 
Xeo
6:06 PM
@rubenvb The code in the question, tested
here's an sscce to copy-paste
just change the return ... line
 
@DomagojPandža It's mostly appeals
Can't really execute them while the appeals are pending
 
@Xeo change it to what? The code compiles fine.
 
@Xeo Yes it compiles in Clang
 
@Collin 27 years of appeals?
 
Xeo
To all three options in the question
 
6:08 PM
return (result);
return *&result;
return true ? result : result;
 
Xeo
mostly interested in 1 and 2
 
@DomagojPandža Yeah, which is why I think it ends up being cheaper to just sentence people to life in prison
At least, I've heard that
 
return *&result; gives an error.
test.cpp:13:12: error: call to deleted constructor of 'X'
    return *&result;   // lvalue is implicitly treated as rvalue
           ^~~~~~~~
test.cpp:7:3: note: function has been explicitly marked deleted here
  X(X const&) = delete;
  ^
1 error generated.
 
Xeo
ok
 
Same with the last one
 
Xeo
6:09 PM
Intellisense chokes on that too, VC itself not
 
yep.
 
Xeo
so, return (result); compiles fine... hmm
 
So Intellisense is actually a better compiler than MSVC?
Go figure...
 
Xeo
EDG frontend, so...
 
You start to wonder why they don't use that in the compiler...
 
6:11 PM
@rubenvb No, they mostly just lobby.
 
Xeo
> The parenthesized expression can be used in exactly the same contexts as those where the enclosed expression can be used, and with the same meaning, except as otherwise indicated.
@FredO ^^
And I have a feeling there was a similar rule for *&, but I can't find it.
 
@FredOverflow Yes. It's disappointing.
 
@Xeo Fuck C++ is complicated :-/
 
Xeo
Btw, the only place where it seems to be "otherwise indicated" is in a decltype-specifier
with all that decltype((x)) stuff
 
@Xeo I thought the same way, but I couldn't find it either (about *&)
 
Xeo
6:26 PM
Maybe it was about &*ptr being the same ptr, but I can't find that either
 
my brother just sad that I was mad boring.. "well, I need to look up something very important"
 
anyone using clang++ with lldb?
 
@Xeo I grep:ed for both &* and *&
 
Xeo
same, only yielded declarations for arcane stuff and the usual &*begin() is range blacookieblub for every bleh...
 
Another class of scary bugs that PVS studio points out that /analyze doesn't is comparing values from two completely different enum types.
 
6:29 PM
to make it even more complicated.. what if the standard really mean "when the expression [result] returned is the name of .." when writing "when the expression is the name of ..." @Xeo @FredOverflow
 
Xeo
@refp Don't conveniently interpret things :P
 
as true ? name : name consists of three expressions, but the returned one will always be "name" - catch my drift? @Xeo @FredOverflow
 
Xeo
It's actually 4 expressions IIRC true, name, name, ?:
 
@Xeo doesn't g++ follow those set of rules? (besides in rand () ? name : name, but that's given)
 
Xeo
6:31 PM
oh wait, true isn't an expression
or is it?
 
it should be
what else is it?
I didn't count ?:
 
Why can't the clang/apple people just ship lldb with support for standard lib containers?!
 
Hey folks.
 
I starting to believe that.. well, couldn't the expression really be about the expression "returned"?
 
Shouldn't be too hard to display a bunch of nubers.
 
Xeo
6:32 PM
I don't think so
 
wouldn't they have written "the whole return statement only consists of return name" otherwise+
 
Yay! Strunk & white badge!
 
@Xeo I'm serious.. :(
 
What happens when an unstoppable force encounters an immovable object?
 
6:38 PM
They kiss and then have sex.
 
posthumous oscar
 
@R.MartinhoFernandes that higgs boson looks sorta dead :/
 
@DesmondHume you should have been there.. yo'mama is so fat and my dick so unstoppable that we experience the happenings of that every sunday!
 
@DesmondHume Impossible, as infinite forces and infinite masses do not exist.
 
Xeo
afk
 
6:40 PM
To contrast with the one I posted in the morning:
 
@melak47 He looks kind of dopey, actually.
 
vot ze fook is zat
 
a koala.
 
The Internet seems to like sharing photos of wet koalas these days.
 
6:43 PM
@MooingDuck Thought you'd like to see your code is spreading.
3
A: Split string in C++

DriseYou could do something like this which requires #include <sstream>: char trash; std::stringstream mystream(myInputString); mystream >> team1 >> goalst1 >> trash>> goalst2 >> team2; or char trash; std::stringstream mystream; mystream << myInputStrin...

 
how does one read in large strings of input in C++ anyway
getline for string datatype?
 
@AgainstASicilian Yea. Then you can use stringstream to split them up.
 
@Drise neat, but your first code does almost no error checking
 
Ok. Back to the Unicodes.
 
@AgainstASicilian I dislike getline, but if you need to know where the newlines are, that's basically the easiest way.
 
6:46 PM
what do you prefer?
 
@AgainstASicilian normally one just cin >> stuff, or use an iterator, and ignores newlines.
 
@R.MartinhoFernandes Godspeed, my friend.
 
cin is quite slow though
versus, say, scanf
 
@AgainstASicilian scanf is shit.
 
it's fast
 
6:47 PM
Hypersonic turd.
 
anyone with clang available who could try and compile this for me std::unique_ptr<int> func () {int * p = new int; return p;}?
 
but hypersonic nonetheless
 
@refp Isn't supposed to compile.
The constructor of unique_ptr is explicit.
But I'll try it if you want. Lemme just fire the SSH.
 
certainly won't compile
 
static_cast<std::unique_ptr<int>> (p); compiles in gcc, and I think the previous should compile
let me find the correct paragraph
 
6:50 PM
No, it shouldn't.
(It doesn't)
 
curious, what do you guys actually code
or do you just tinker around with arbitrary chunks of code for fun
 
return static_cast<std::unique_ptr<int>> (p); <- does compile
 
That's different.
 
*"A return statement with an expression of non-void type can be used only in functions returning a value; the
value of the expression is returned to the caller of the function. The value of the expression is implicitly
converted to the return type of the function in which it appears"*
 
That is an explicit conversion.
 
6:51 PM
@Drise I find it quite interesting that people do not mention string::find(..) and string::substr(..)
 
@R.MartinhoFernandes the above quote says that it should happen implicitly
 
No. It says an implicit conversion should happen.
 
but they come rather with stringstream or something
 
There's no implicit conversion between int* and unique_ptr<int>.
 
@R.MartinhoFernandes no, that it is going to happen..
 
6:52 PM
No implicit conversion can happen because there's no implicit conversion.
 
@R.MartinhoFernandes I thought the conversion was explicit but implicit from the developers point of view?
 
@refp No, it's just explicit.
 
I blame the language barrier if this isn't the case :(
 
@refp that quote explicitly says an implicit conversion happens. However, there is no implicit conversion, so it fails.
 
6:53 PM
@MooingDuck ah alright, kthxbye!
 
> An expression e can be implicitly converted to a type T if and only if the declaration T t=e; is well-formed, for some invented temporary variable t (8.5).
 
@R.MartinhoFernandes gotcha
 
@Nils Stringstream does it all for you.
@MooingDuck Hm?
 
@cat You should put @JimNorton up there (being a C programmer and all)
Yeah, I don't think so... I've beena good contributor here.
 
6:55 PM
@Nils why would you use those? That's harder and thus more error prone
 
@Nils You mean std::find and that std::string constructor?
 
just find and substr
 
@JimNorton Don't worry, it would be incredibly silly to do so. Even by our standards :)
 
(std::string could really have been a std::vector<CharType> that appends 0 at the end for what it's worth)
 
To reply to someone, you click the little arrow, not copy and paste what that person said. Thanks.
 
6:55 PM
I never exactly know what stringstream does.
 
It streams strings.
 
lol
It's a memory-based stream.
 
It streams to and from strings.*
 
@CatPlusPlus That works even when it's from the transcript?
 
@Drise input "CFC 1 10 RES" and your code succeeds, with the wrong values. My code returns a fail state and aborts.
 
6:56 PM
@R.MartinhoFernandes :-)
 
@JimNorton You'd probably have to type the number manually for that.
 
Yes. If not, type :id before the message.
 
But it'd work if you did.
 
What delimiter does it use, how to change?
 
@MooingDuck Fair enough. Not like it seems the OP cares though.
 
6:57 PM
@Nils Why would it use a delimiter?
 
@Nils It works exactly like any other stream based object
 
@JimNorton I believe you can click the arrow, then "reply to this message". Slightly harder, but still doable.
 
how does a fucking stream object work?
 
ah it streams stuff
of course!
 
6:58 PM
@Nils you know about std::cin right? And std::cout?
 
@MooingDuck ah... thanks for the tip
 
@MooingDuck That's how I do mine. Otherwise, the other arrow tends to move on me when the room is filled.
 
stringstream holds a string and streams to and from that by using the same operators you can use for any other stream.
 
@Nils (and nobody knows how the fool things work)
 
I know that I can do std::cout << somestuff
it seems to work for strings, ints and floats but still
 
6:58 PM
@Nils Well, instead of cin >>, you use mysstream >>
 
@Nils wouldn't you like to "mystring << "value is " << myinteger;"? stringstream does that.
 
yes I know
 
stringstream is just a glorified way to talk about modifying stuff about your output
 
What.
 
@Nils so what is it you're confused about then?
 
6:59 PM
I use stringstream for int2string converstation.
 
@AgainstASicilian Erm, it's usually for manipulating input stuff.
 

« first day (639 days earlier)      last day (4308 days later) »