« first day (424 days earlier)      last day (4525 days later) » 

9:00 PM
I could guess NS:: but rvo is kinda obscure even in these part of the woods, maybe in the lisp chatroom =)
 
RVO is a common and well-understood term in C++
there's nothing obscure about it
 
ok, I appreciate the education of course
 
Xeo
@RMartinhoFernandes Right, I somehow thought you had that as std::vector<T const> const final for some weird reason, and I think std::vector<T const> isn't constructible from std::vector<T> IIRC
 
Now you are getting me curious about the relation to tail-call optimisations? any relation?
 
Xeo
@RMartinhoFernandes () -> std::vector<T> unneeded.
 
9:01 PM
@Xeo Why on earth would that happen?
 
() is not needed, but the return type is needed.
 
@Xeo Needed. There's no inference on multi-statement lambdas.
 
It can only be skipped if entire lambda is return.
 
Xeo
Argh, right.
Damn deduction deficiency.
@DeadMG, I hope your lambdas do better
 
of course
 
9:03 PM
I wonder why you can't say auto foo() { return 42; }.
 
I ejaculated a healthy splurge of type inference all over WideC
 
At that rate, you'll have to rename it to WhiteC.
 
lol
I was about to suggest that only Martinho knew the meaning of the word
 
Xeo
9:04 PM
@DeadMG Just checked against MSVC, GCC and Clang - all error on this:
#include <vector>

int main()
{
    std::vector<int> v;
    std::vector<int const> const vc(v);
}
 
vc(v.begin(), v.end())?
I think vector<T> has no vector<U> constructor.
 
Xeo
@CatPlusPlus that would work, but because we want to move, you'd need make_move_iterator, which is what I coded above :P
 
@Xeo Because there's no such constructor?
 
How can something without a knee take an arrow to the knee. I have crappy stuff that I want to convert to a guard.
 
Wasn't there move_iterator in stdlib?
 
9:05 PM
Yep.
 
user34537
First thing i read is an arrow to knee joke...
 
@CaptainGiraffe NS is namespace so namespace { std::vector<int> foo() { ... } }. RVO=return value optimisation where implementations can legally skip the copy constructor
 
Xeo
@RMartinhoFernandes Yes, and with my reasoning that I thought you had a std::vector<T const>, I coded up the stuff earlier
@CatPlusPlus sure there is
 
I just read the wiki on RVO It's all about the obvious, (and very similar to tail call optimisations), What am I missing?
 
Oh, ok. Just checking.
 
9:06 PM
@acidzombie24 Then apparently you don't know how to scroll up?
 
Great, now what I thought was going to be "just a quick two-liner function" is totally blown out of proportion :(
 
@awoodland Is RVO defined by the standard?
 
Xeo
@RMartinhoFernandes lol, show!
 
I have browsed it quite a lot but not found any mention of it.
 
it's referred to as "copy ellision"
basically, compilers are allowed to assume that constructors are pure functions in some specific cases
 
9:09 PM
@DeadMG Ah
 
If someone puts non-copy logic into copy ctor, then they deserve all the bugs.
 
Xeo
@CatPlusPlus But my tracer won't work without the logging statements there. :(
 
@R.MartinhoFernandes Long as it doesn't pay in bytes. I want the pizza intact.
 
If you're tracing copies, then you wouldn't want them to be logged when there's no copy, no?
 
9:11 PM
@DeadMG The situations I have encountered those assumptions they all seemed reasonable to me
 
well, in a very realistic sense, the Standard is telling you that if you violate them, then good luck
 
Maybe we should have no-copy ctor.
 
@CaptainGiraffe A lot of things seem reasonable to someone suffering from delusions.
 
9:12 PM
A constructor that runs when the copy is elided!
Well, not constructor per se.
 
@Xaade really? Please expand.
 
Stop pinning your own stuff to star it.
 
@Xaade Stop cheating!
I was thinking of starring it, but now I won't, because it's dirty.
 
We have no choice. It needs to be burned.
 
9:14 PM
What are my delusions?
Hi Johannes!
 
> int is an object. "The constructs in a C++ program create, destroy, refer to, access, and manipulate objects. An object is a region of storage."
 
A delusion is a false belief held with absolute conviction despite superior evidence. Unlike hallucinations, delusions are always pathological. "I can only survive if I drink 30 gallons of milk a day. It's absolutely reasonable to assume so."
 
Sigh, Markdown illiterates.
 
funny how that statement uses the quote to prove soemthing completely different (the other direction)
not every region of storage is an object
 
@RMartinhoFernandes uncheated.
 
9:15 PM
Functions aren't, but that wasn't relevant.
 
@Xaade Your qoute would fare better if it in any way related to my comment.
 
Also, it doesn't say "region of storage is an object".
It says "object is a region of storage".
 
@CatPlusPlus an object has a type. a region of storage doesn't have a type
 
Wait, you people don't drink 30 gallons of milk a day?
 
a region is defined by a begin and end
(and possibly holes)
 
9:16 PM
Okay, how is that relevant to int?
 
@RMartinhoFernandes Only when I'm hungover.
 
@Xaade I prefer to make a distinction of an object, an instance, a variable.
 
How much is a gallon?
 
@CatPlusPlus because a region of storage storing an int is not an object unless the standard makes it one.
 
> 1 US gallon = 3.78541178 liters
 
9:17 PM
So you're saying int is not an object?
 
Ouch, that's more than 100 litres.
 
@CatPlusPlus int is a type
 
An int is an object.
 
int x; then x is an object
 
Ok, I'm not going to argue little words.
 
9:18 PM
People speak in English here.
 
object <==> type is not in the standard
 
@RMartinhoFernandes It seems reasonable not to. Unless I'm delusional. If I were I'd assume that every situation that a constructor can be counted as pure functions, were perfectly reasonable. Unless I weren't delusional, at which point I would cease considering understanding the internal fiascoes of a compiler.
 
@CatPlusPlus but not by that standardese you are quoting
 
I have better things to do than argue with nitpicking.
 
Xeo
@CatPlusPlus We are in Lounge<C++>, you have too.
 
9:18 PM
because that standardese defined the opposite direction
 
Sheogorath, you now make more sense to me.
 
that every object is a region of storage. not that every region of storage is an object
@CatPlusPlus it is not nitpicking. 10 has type int, but is not an object
 
@Xaade Stop confusing me!
 
Thats where the term instance comes into play, an instance is an object in storage
 
@CatPlusPlus "Nitpicking, your such a slobe. You make things difficulty" "No I don't" "You know what, I don't have time for this, I have better things to do."
 
9:20 PM
saying "int is an object" is therefor not a senseful thing to do, even if we suppose a communication partner that tries to make sense of it
 
Well, guess what: lots of people made sense of it. Draw your own conclusions.
 
@RMartinhoFernandes What's 6 by 9?
 
an object can be (temp_obj).member()) nowhere near storage
 
@RMartinhoFernandes you == "lots of people" ?
 
10 is also not a region of storage, it's a literal.
 
9:20 PM
@CaptainGiraffe uh.... on the heap.
 
@CaptainGiraffe that is not true. every object has storage
 
@Xaade Are you trolling hard?
 
@JohannesSchaublitb you can be plural.
 
@JohannesSchaublitb The comment has 4 votes, and none of them is mine.
 
@RMartinhoFernandes 4 == lots of people
lol
 
9:22 PM
Also the question was about int variables. Use the context, Luke.
4
 
@CaptainGiraffe anything can be in storage in memory. Objects are located in the heap.
 
@JohannesSchaublitb See, you're doing it again.
 
also, lots of people does not mean that something does make sense. it is an evident fact that many incorrect comments and answers have been upvoted on SO
 
no way
 
@Xaade Any const member can be non storage afflicted
 
9:23 PM
operator new(100) returns a pointer to a region of storage (100 bytes), but there is no object
 
@JohannesSchaublitb No, it does make sense. It may be the wrong sense. But if people have a consensus it does make sense, however wrong it may be. (See: Global Warming)
 
Well, I'm going to play with concatenative languages.
 
@JohannesSchaublitb What about the elusive Math Object
 
@CaptainGiraffe someone was saying that an int variable is not an object. and you made a comment that apparently tried to prove that an int variable is an object. however your comment did not prove that
 
@JohannesSchaublitb that is a horrible thing to do.
 
9:24 PM
@Xaade yes
 
@JohannesSchaublitb we need to differentiate between instance(storage) and object(type)
 
now please troll outside
 
lol, Johannes asking someone to stop trolling.
 
@CaptainGiraffe C++ does not know the term "instance"
other than in the plain english "for instance" meaning
 
@JohannesSchaublitb @Captain is wrong. He should look up Java, everything is an object there. Int is not a fucking object.
 
9:25 PM
Not everything is an object in Java.
Unboxed values are not objects.
 
@Xaade aaaahaha
 
I don't see why int shouldn't be considered an object
 
@JohannesSchaublitb > lolz
 
int is a type. 10 is not an object. int() isn't either. *new int is
 
@CatPlusPlus Actually, there are no boxed values, just instances of wrapper classes.
 
9:26 PM
Yeah, we call 'em boxed values.
 
I call them crap.
 
In C, every region of storage is an object. but not in c++
 
Because they're boxes. With values.
 
Autoboxing is a sport where cars punch each other repeatedly.
 
autoboxing is where you get a robot to put things in a box
 
9:27 PM
C's objects are dumb. have no type, have basically nothing apart of range information. C++'s objects are actual entities that have properties (lifetime, type, and such)
 
@Johannes Crap this is my last for the evening: An instance is a useful term to use for a memory location or an l-value. most stuff in an expression has a type, only counterexample I can think of is the ternary ? : operator, that has its own rules
 
@JohannesSchaublitb Because it misses all that header data and stuff.
 
My mistake was ever getting into language lawyer debate.
Sigh.
 
@CatPlusPlus Don't worry, you'll learn.
 
don't worryw
with me as the legislature, there will be little need for such debate
 
9:28 PM
@CatPlusPlus catstarratin+3 and a shinifurrating of +4
 
@CatPlusPlus you could draw a graph over the entity kinds of c++
 
cpx
anything allocated by new is not an object?
 
My granny had a great quote for this type of situation
 
then you can say that types can be instances of templates. values can be instances of objects. objects can be instances of types.
 
malloc!
 
9:29 PM
@CaptainGiraffe Does that mean something? Or is that just random stuff you typed?
 
@CaptainGiraffe No it is not your last. + doesn't have a type. Most stuff in an expression doesn't have a type: (, ), ,, ., +, -, ->, [, ], ,,,,,,
 
cpx
Hm, if int (*p)[5] = new int[5][5] doesn't point to an array object, may i treat it as a one dimensional array?
 
templates can be instances of other templates (member templates)
 
Yeah, the result of an expression has a type. But the expression itself doesn't.
 
@cpx it points to an array object
@EtiennedeMartel no, the expression itself has a type too
the result of the expression does not necessarily have a type
 
9:30 PM
Really? Strange.
 
for example, (void)0 denotes nothing. it is just a void expression
 
cpx
but new(100) as you said is not an object
 
it has no "result"
 
Oh, right, I forgot about void.
 
the expression has type void
 
9:31 PM
@CaptainGiraffe I was just checking if I should bother trying to decypher it, no need to get violent :)
 
@EtiennedeMartel At least it's not C# dynamically compiled expression objects.
 
@EtiennedeMartel it is for a reason that decltype(x) and decltype((x)) are different
the latter determines the type of the expression (modified if x is an xvalue or lvalue), and the former determines the value of the "result" of the expression (the referred declaration)
 
@cpx He said operator new(100).
 
cpx
Oh i see.
 
note that an expression cannot have reference type, for example. that's an important property of expressions. and rvalue expressions of type "cv T" where "T" is a non-class / non-array type cannot be cv-qualified (cv is always empty)
 
9:34 PM
Hmm.... expressions have types?
 
Is there an stdlib one-liner that checks if a string contains any of the strings in a container
 
@Xaade Why did you move that?
 
@Xaade their type is what they evaluate to isn't it
 
lol
make it an SO question xD
 
I don't think you need any more rep.
 
9:36 PM
> Cat is a functional stack-based programming language inspired by the Joy programming language.
 
@RMartinhoFernandes expressions can be moved?
 
Where did you find that?
 
Sounds like you. Except for the functional part.
 
In C, actually only the expressions have a type
not sure about functions
 
Oh, hey, you could make an improved version of Cat and name it Cat++.
 
9:37 PM
but objects have no types
 
On the other wiki, under 'concatenative language'.
I like how they include entire implementation of core language in Scheme on the spec page.
 
they only have an "effective type", but which is only defined by the type of the expression used to access the object (by the first write operation until the next write operation, or something) or by their declared type if there is any, anyway.
 
@JohannesSchaublitb C haz object?
 
I'm bored.
 
9:39 PM
lol
 
Entertain me.
 
my milk is empty :( i forgot to buy new
 
cpx
lol
 
@CatPlusPlus You're investigating this for school or something?
 
No.
I want to write one!
 
9:40 PM
void f() { return "Hello world"; }
 
@CatPlusPlus Ahhh. So, the build system is not going to happen?
 
Please keep the return type of f and the return "Hello World" thing, but insert something to make this code valid!
no comments, PP, trigraph, stringliteral tricks PLZ.
 
cpx
(void)
 
where can you validly insert it :(
 
@RMartinhoFernandes Yeah, that never had a chance.
 
@JohannesSchaublitb now you're talking sex again
 
Also, this seems more interesting.
 
9:44 PM
@AlfPSteinbach please enlighten me on how to "talk sex". I will try it out on the hot dudes in the train tomorrow
 
Hot dudes? Eew..
 
Damn, my headphones are barely holding together.
 
Try duct tape first.
 
Duck tape.
 
Duck taping.
 
9:46 PM
Duct typing
 
Evolution.
 
Ducvolution.
 
Revolution (hypothetically).
 
Robolution.
 
Xeo
Hm, whatever happened to std::chrono::date‌​.
 
9:47 PM
@JohannesSchaublitb return "Hello World", (void)0;
 
My wine tastes like fish.
 
@keithlayne WOW!
@StackedCrooked EWW
 
@JohannesSchaublitb idd
 
Xeo
9:48 PM
@RMartinhoFernandes So we still have to use the C stdlib functionalities? (or Boost)
 
Boost.
 
@keithlayne that's AWEsome
 
@Xeo You can get current time from std::chrono::system_clock::now() but any kind of YMD stuff needs to be done with that stuff.
 
Xeo
@RMartinhoFernandes Damn.
 
@JohannesSchaublitb are you just making fun of me now?
 
9:49 PM
BTW struct A { operator void() { cout << "huh?"; } }; int main() { A a; (void)a;} outputs "huh?" on GCC
 
Xeo
I really liked the look of that std::chrono::date stuff
 
is that allowed by the spec!?
 
How about return "Hello World", void(); I haven't tried it though. But just to find a usage for that construction.
 
i thought that a void cast has no effect
 
Xeo
@JohannesSchaublitb lol?
 
9:50 PM
7 mins ago, by R. Martinho Fernandes
; http://www.ideone.com/DHT0u
 
Xeo
Is it even valid to specify a conversion operator to void?
 
@keithlayne nono. i really appreciate it!
@RMartinhoFernandes oh you edited in the ideone link later xD
first you just said ";"
 
@JohannesSchaublitb that operator void is andrew's old suggestion. he thought you could prohibit use of object as expression statement
 
i didnt notice the edit
@RMartinhoFernandes ahh wait
your answer is invalid
 
9:51 PM
i said you uneed to keep the return statement thing (excluding the semicolon)
 
@AlfPSteinbach but GCC is incorrectly invoking it here
 
> The rationale for this is that there exists no country on the planet which uses any other ordering. This is in contradiction to [locale.time.get] which specifies the above three orderings plus a ydm ordering. There is no inconsistency in not offering a year/day/month ordering. No current code will be invalidated. This is simply a lack of support for the ydm ordering.
 
the spec says that operator void shall not be invoked implicitly
 
They should also ban mdy. No sane country in the planet uses it.
 
cpx
9:52 PM
return (void)"Hello Word";
 
@JohannesSchaublitb can you try to make it explicit...?
 
Xeo
@RMartinhoFernandes Damn Merkins.
 
@AlfPSteinbach what do you mean by "andrew's old suggestion" ?
 
Xeo
@cpx return "Hello World" should stay like that
 
@AlfPSteinbach i don't know the behavior of this GCC extension
 
9:53 PM
andrew koenig
 
oh did you mean that operator void was invalid before?
i see!
 
explicit operator void()
 
tho since the spec says that operator void or operator THisClass or operator BaseClass (or references to them) shall not be invoked implicitly
 
@AlfPSteinbach dunno what GCC's behavior is on that. the spec definitely won't make any difference
what did andrew suggest? did he during standardization suggest the operator void?
and it was invalid before that point?
or did he just suggest to GCC developers to implicitly invoke it?
I wonder whether it will trigger an operator T() (templated) with T = void
that would be big fail
 
Xeo
9:55 PM
@JohannesSchaublitb Isn't (void)a; pretty explicit?
 
@Xeo the call is still implicit :)
a.operator void(); is explicit call
 
cpx
@Xeo May I change the return type of function?
 
Xeo
@cpx No.
 
@Xeo what are the rules?
 
"Allow a class to define operator void() as a member, with the notion that it would be called any time a value of that type is discarded, such as the expression in an expression-statement or the left operand of a comma operator. For example, that would allow the I/O library to flush an output file exactly once in an expression of the form

std::cout << "x = " << x << "\n";"
 
Xeo
9:57 PM
@JohannesSchaublitb Eh? You provided them. :s
 
cpx
Hmm
 
@AlfPSteinbach ah
 
but it was in not very serious forum on facebook
 
tho apparently the spec did not follow his advice completely?
@Xeo haha JK!
 
@AlfPSteinbach That sounds really cool.
 
9:58 PM
@AlfPSteinbach ohh i see
it was on facebook
 
Xeo
Fuck, my whole body hurts. I can't even reach out to the light switch without it hurting.
 
@JohannesSchaublitb well the std says in note, "A conversion to void does not invoke any conversion function (5.2.9)"
 
@AlfPSteinbach yep that is true
the spec is also normatively clear about that. somewhere in clause 12 about conversion functions
 

« first day (424 days earlier)      last day (4525 days later) »