« first day (330 days earlier)      last day (4620 days later) » 

6:00 AM
Retrieve the object inside the reference and copy it, instead of copying the reference (which accomplishes nothing).
Which is a lot like what std::bind does, for what it's worth.
 
That's already taken care of due to other properties of the EDSL though.
 
Well, I have no idea about these embedded languages. Never used them.
 
e.g. bind(stuff goes here) == ref(i) has to work, and if you got that to work then your example will work too.
But if you care about that for your code, when you can add an overload accepting std::reference_wrapper.
 
I do like reference_wrapper, but I do not like the idea of overloading val and acknowledging the imperfection of perfect forwarding ;v)
 
What imperfection?
 
6:04 AM
Nothing per se, but it's not the complete solution to this particular problem.
Although, for the sake of argument, if std::remove_reference< std::reference_wrapper< T > >::type were T, my given implementation would handle this case.
 
Yeah, we've went from std::bind(functor, by_val, std::ref(by_ref)); to std::perfect_bind(functor, val(by_val), by_lref, std::move(by_rref));. That's not so much a property of perfect forwarding though as to the semantics of bind (local copy or action at a distance?).
@Potatoswatter Oh wait, you're right.
std::decay handles std::reference_wrapper.
Let me check if that's the ccase for remove_reference, too.
 
It's not. Just checked. Thanks for the info on std::decay, though.
 
Mmmh std::decay doesn't do that either. I'm not sure what I'm thinking of here.
If you're not familiar with std::decay it 'restores' value semantics from perfect forwarding.
Speaking about TMP though, it's not used for forwarding arguments.
 
@LucDanton ?
 
Does anybody have an opinion on the portability of using Boost::Threads? Can I build the same code with ICC on Windows and Linux?
 
6:11 AM
template<typename... T> std::tuple<typename std::decay<T>::type...> make_tuple(T&&...); for instance.
 
@Misha Yes, that's pretty much the point of it.
 
Uses perfect forwarding, but the returned type holds 'copied' types from the original T's.
So the caller can do make_tuple(42); or make_tuple(i); or make_tuple(std::move(i)); and the resulting tuple is the same; perfect forwarding is used for convenience to the caller.
std::forward_as_tuple on the other hand does exactly what the name implies.
 
I understand about decay (although I hadn't thought about using it here), but I wasn't clear about TMP "not used for forwarding arguments"
 
Well, there's no std::decay function template that does anything remotely similar to what you want.
Although perhaps you'd like that name more than the quite abstract val :)
 
Well, it can never be called std::decay because a function template cannot have the same name as a class template.
It sounds like the best precedent is calling it val.
Although copy is still probably clearer about what actually "happens."
 
6:17 AM
@Potatoswatter Hopefully you don't put your code in the std namespace :)
Also copy is a problematic name when it comes to arrays and functions.
 
No, but my naming convention is to do what the standard library would do.
Particularly for a utility which will hopefully one day be standardized.
 
But the Standard Library is designed by a committee, wants to avoid naming conflicts at all costs, and wants backwards compatibility... Do you even have the same requirements?
That's the Standard Library that uses std::forward_list and std::unordered_map for single-linked list and hash maps respectively.
std::move is already decried as a bad name!
 
Yeah, lol. But they went with move anyway… and various other names that are likely to be used by someone-or-other.
At a certain point after TR1, they just gave up, right?
 
I guess so, heh.
I have my own forward_bind and forward_function and I feel bad about those names just because of std::forward_list
 
hahaha!
std::forward< forward_list< … > >
 
6:21 AM
Mmmh, that's a good question to ask around here. Is there a good naming scheme for a move-only type that is based on a preexisting type?
There used to be unique_future vs shared_future, but that went future vs shared_future, which was a good move IMO.
So if I want a move-only version of std::function, what do I call it?
 
Very good question…
 
I'm not sure why I decided to call it forward_function but it needs a new name I think.
 
Probably just functor, since that's probably what you have.
 
Come again?
 
As opposed to std::function which is a reference to a functor.
 
6:26 AM
Morning. You guys are up early.
 
functor<int(double)> f = std::bind(stuff goes here);?
 
If you need move-only semantics, then presumably it contains something. Right, like a bind expression.
 
@Potatoswatter Well, std::function stores and owns copies...
 
Ah, I'm still not totally clear on those semantics.
So when you pass a non-copyable underlying type to std::function, it just complains?
 
I'm not sure when the error happens (i.e. at construction/assignment or copying), but yeah it requires that the type be copyable.
 
6:28 AM
Yes, constructor requires CopyConstructible.
 
Hence my need for a move-only version.
I know that I can rename my forward_bind perfect_bind since it's not about move semantics.
 
What happens if you pass a move-only type to std::function, and avoid anything that would require a copy?
Why isn't function being CopyConstructible simply conditional on the underlying type, as with the standard containers?
 
If I understand how library requirements work, then it's not specified where the error happens. The program is simply invalid as far as the Standard goes.
@Potatoswatter But there's no underlying type since it's type erasure.
On the other hand, the returned type of std::bind is guaranteed to be conditionally copyable depending on the underlying type :)
You need two different erasures, one which is move-only, one which is copyable.
 
I didn't realize function and bind were so different.
 
So I rolled my own so that I can store those move-only functors, which are quite convenient.
 
6:34 AM
So then, why not just bind your functor to nothing and use that?
The remaining problem is to set is_bind_expression to false :vP
 
@Potatoswatter A move-only wrapper type solves the same problems as a copyable type-erasure wrapper.
Well, roughly. You can't copy it obviously.
Simple example: store a callback that can be set and reset at any time of some object's lifetime.
Anyway, shower time.
 
Hey, thanks for all the insights!
 
cpx
int i = 10;
char * const c = (char*)&i

Hm, Would this get me the least / most significant or the byte at lowest / higher address?
I'm keep forgetting how does it work or maybe i never learned :(
 
It depends on endianness… and you really shouldn't do this with by casting.
The LSB is 10 & 0xFF. The MSB is (unsigned) 10 >> ( numeric_limits< char >::digits * ( sizeof( int ) - 1 ).
 
cpx
I thought it would get me the byte at lowest address but to check if it is least or most significant should depend on endianness right?
 
6:49 AM
The lowest address is static_cast< char * >( & my_int ) and the highest is static_cast< char * >( & my_int + 1 ) - 1… but again you shouldn't be doing that.
 
cpx
The C++ spec (§4.7/2) guarantees that narrowing conversions always discard the
most-significant bytes by giving back the 'smallest value' congruent to the original
integer.

Does that make sense here?
 
Yes. For unsigned types, anyway. Signed overflow is UB. Or implementation-defined, I think. Anyway, don't do it.
If you're asking whether endianness affects overflow, no, it does not.
 
cpx
I see.
 
cpx
7:17 AM
oh, should the cast needs to be a reinterpret_cast when your reinterpreting the int* to char*?
 
Als
This was amusing
-7
Q: <"> (double quotes) key not working during interview, how to write program?

iammilindWant to share one interesting real life incident. Once I was in an interview and was asked to write a program using either C or C++ (just FYI: enter city codes and enter telephone numbers. Then arrange phone numbers for given city code). After few minutes, while writing printing statements usin...

 
cpx
7:33 AM
Not sure if peer pressure badge applies to deleting your own downvoted questions but you can't delete upvoted questions.
 
Als
you cant downvote own questions
 
cpx
oh I mean downvoted by someone else :)
 
Als
@cpx: Can you reframe your say, You are all over the place with that one, making little sense
 
@Als Very silly to close, it belonged over at programmers. But anyway, [Alt 33].
 
Als
@AlfPSteinbach: Silly to close? why?
 
7:39 AM
good question for some other stackexchange site, should be moved.
i don't know the procedure for moving though
i guess there must be one because i have seen questions moved
it could also be a question for C++ programming
 
Als
I thought that, in no time people will be able to answer the question. seems like playing tricks and games and acknowledging it
 
using them ?? trigraphs
but nobody remembers them so nobody would have expected that in an interview
 
Als
trigraphs yes...
 
in the worst case I'd used Unicode \u001F and then said hey, g++ is non-conforming!
 
Als
@AlfPSteinbach: Then it was dumb way of posting the q then
 
7:41 AM
yes i guess
 
Als
he could have reformatted it look like an question rather than making it look like a trick question
 
sorry that should be Unicode \u0021
argh
plus or minus it boggles my mind!
 
Als
@AlfPSteinbach: The q is reopened and me is voting to move it
 
I have seen that closing behavior so many times now here on SO. "I recognize that I don't know shit about what he's asking, so I vote to close"
 
Als
I hate trick questions, where OP brags about how i solved it
 
7:44 AM
:)
 
Als
well if you want to know good or better answers, you format the q well so that you get good answers, not act like a dumb show off...saying i could answer it, let me see how well you guys can.
And this case, it seems a petty case of garnering some rep
 
cpx
@Als sorry, I mean is it not possible to delete your questions that got downvoted for peer pressure badge? :S
 
Als
@AlfPSteinbach: I think the OP just made up the Q and the answer from this..
8
A: What's the alternate character combination for the double quote characater in C/C++?

dirkgentlyNone as per the standard. Try including a header with a macro: #define QUOTE(x) #x and generate a printf as: printf(QUOTE(hello));

@cpx: I think peer pressure badge is for Answers not Questions
 
Anyway, I checked, and while keypress [Alt 33] (on numeric keypad) of course works in Windows, there is no trigraph sequence for ", and \u0021 doesn't work because a Unicode thing can't designate a character in the basic character set. So of my three solutions only first one survived. But I learned fourth one from above question, namely using the preprocessor to stringize, I didn't think of that.
 
cpx
hm so maybe you can't delete questions at all after any +/- votes
 
Als
7:54 AM
@cpx: I am learning to not give a fuck about downvotes and upvotes, so please spare me the talk on those.
 
0
Q: getting an element from a tuple

FredOverflowCalling get does not seem to invoke argument dependent lookup: auto t = std::make_tuple(false, false, true); bool a = get<0>(t); // error: unknown identifier 'get' bool b = std::get<0>(t); // okay Why?

 
@fred: i think that looks like compiler error, have you tried comeau?
 
online comeau doesn't have tuple and get. ICC would, but that's money.
 
i discovered. give greg a nasty stare.
 
It hasn't been updated since 2008-ish, and it's not clear if it's just the free version or if the pay version has been revised. It would seem not. Probably because people weren't paying.
 
8:04 AM
@Potatoswatter "ICC"? I can't get any of the explanations to fit.
 
"Intel C++ compiler" would be my guess.
 
Intel C++ Compiler, which uses the same EDG (Edison Design Group) frontend that made Comeau so compliant.
 
Oh, I was thinking like, Illinois Central College, nah.
Or International Cricket Council.
 
"Inverted Coroutine Call"?
 
Impossibly Compliant Compiler
 
8:06 AM
you mean comeau? :)
 
Not for C++11 it ain't
Heck, tuple is part of TR1, so online Comeau being post-2006 really should have it.
 
what would include be for TR1 version?
like <std/tr1/tuple>?
 
Depending on your platform, either <tr1/tuple> or <tuple>
Microsoft chose to put everything in the same header, GCC separated them.
The one thing that TR1 didn't standardize was the header names.
 
i can't remember such things. anyway, i tried both versions with comeau online. no dice.
 
I'll see if clang still works on my machine.
Guess it doesn't :/
 
8:11 AM
Hmm, looking back at TR1 again, I get the impression that their intent was that you reconfigure your compiler to look in the tr1/ directory automatically, and always write #include <tuple>.
 
clang++ doesn't accept the code either (switching from C++11 to TR1 for it to work)
 
Hello
can't believe you guys are still on :)
 
but why?
 
We're spread across the world.
 
@LewsTherin 'still'? It's 10am on a Sunday.
 
8:13 AM
yeah but it is 9:13 a.m yeah...too early to be awake considering we were up late ha ha
I have a question about how pass by value works
when I have
`
int a = 10;
pass(a) ;
`
What happens...a copy of a is made yeah?
when pass(a) is called
 
Assuming an appropriate signature for pass, yes.
 
define pass
 
e.g. void pass(int);
 
yeah
 
that's by value, yes
 
8:15 AM
exactly it Luc
yep, so I am wondering what steps take place
a is copied on function call
 
it's formally a copy construction
 
@LucDanton would be nice if you could add that as a comment to my question to assert that I am not insane ;-)
 
but for an int it's a simple copying
 
@cpx yes, sorry, it's a reinterpret_cast. And you can't dereference the resulting pointer, which reflects the fact that C++ doesn't require an implementation to commit to big-endian or little-endian. On a machine with strict pointer semantics it could, I believe, crash.
 
which might even be optimized away
 
8:16 AM
@FredOverflow TR1 doesn't seem legitimate :(
 
@AlfPSteinbach yeah but I want to know the steps
 
cpx
@Potatoswatter :)
 
Ok, so a is copied on function call, when it reaches the function body
 
@LewsTherin Initialization of parameters is done by the caller prior to entering the body of the function.
 
@LewsTherin do you mean in the machine code?
 
8:17 AM
@LewsTherin At the language level there is nothing more to say.
 
I am just tryiny to see how a copy constructor makes an infinite loop
 
cpx
I was thinking it could be some feature in C++11.
 
if you pass by value
 
@LewsTherin A copy constructor cannot go into an infinite loop. The language requires the argument to be a reference.
 
if I do
well recursion*
 
8:17 AM
LOL… the infinite loop doesn't happen at runtime.
The compiler will refuse to compile it because the copy ctor is required to call itself.
 
I know, but in theory it should..and I want to know why that happens
 
It's a logical impossibility… so it says it can't and that's the end of that.
 
@Potatoswatter Are you sure you're not allowed to read the byte representation of any object?
 
@LewsTherin Show us code, it's hard to tell what you're asking.
 
@LewsTherin What theory would that be.
 
8:18 AM
@LucDanton Ah, forgot that char is special.
 
@LucDanton what do you mean "TR1 doesn't seem legitimate"?
 
'
Dog jack = Dog() ;
Dog sam(jack) `
 
@LucDanton The standard explicitly allows reading the byte representation of an object via char* and friends.
 
that would invoke the copy constructor to copy jack into sam
 
@LewsTherin jack is passed by reference, end of story.
 
8:19 AM
@AlfPSteinbach Fred illustrated his question with C++11 code. Presenting a similar but not identical case means introducing new variables. I like to isolate my problems :)
 
Ok, but why?
That's what I want to understand
 
Probably because it means finding a semantic meaning for that. I have no idea what T(T); would mean.
 
@LewsTherin Why what?
The copy constructor is defined by the language to have a reference parameter. There really isn't more to it than that.
 
@LucDanton I still don't understand that. TR1 has tuple. I'm looking at it right now.
 
8:21 AM
@AlfPSteinbach I can't know a priori that <tr1/tuple> and <tuple> will behave identically.
 
> A non-template constructor for class X is a copy constructor if its first parameter is of type X&, const X&, volatile X& or const volatile X&, and either there are no other parameters or else all other parameters have default arguments. [12.8 §2]
 
@Luc: But we're discussing just ADL here?
 
The answer lies above in the list that shows the cases where a copy constructor is called. A copy constructor is called when a parameter is passed by value. If we pass our cSource parameter by value, it would need to call the copy constructor to do so. But calling the copy constructor again would mean the parameter is passed by value again, requiring another call to the copy constructor. This would result in an infinite recursion (well, until the stack memory ran out and the the program crashed)
 
@AlfPSteinbach Well I don't care, that how I run my experiments. If the variable is "what compiler I'm using" I won't damn change the code, too. Science!
 
That's what it says on the link
 
8:23 AM
> If we pass our cSource parameter by value, it would need to call the copy constructor to do so.
Which would be impossible, the language doesn't allow it.
 
hm, you think there might have been some ADL rule change, or change of result type of make_tuple, or something
 
@AlfPSteinbach I don't want to make any assumption.
 
@FredOverflow Can we just assume it does..I know it would give me an error
 
is it possible to check ADL on some other auto variable?
 
@FredOverflow Not only that, but it's illegal to declare a "copy constructor" with argument type X. (12.8/6)
 
8:24 AM
but assuming it does. how would it give an infinite recursion
 
@AlfPSteinbach Sure, auto variables are statically typed just like non-auto variables.
 
auto v = std::vector<int>( 666 );
swap( v, v );
 
auto make_vector = []() -> std::vector<int> { return { 1, 2, 3 }; };
auto v1 = make_vector();
auto v2 = make_vector();
swap(v1, v2);
@AlfPSteinbach Great minds etc :)
 
@LewsTherin T x(y); would call the copy constructor to initialize x with y, right? Assume the copy contructor were defined as T::T(T z). z would have to be initialized with y by the copy constructor. This is where the endless recursion starts. Get it?
 
8:26 AM
Compiles fine.
 
@FredOverflow so that means when x(y) invokes the copy constructor a copy of y is made..which reques the copy constructor...
but does z not have the value by then ? or must the copy be copied into z?
 
How is a value parameter initialized? By calling the copy constructor!
Copies don't magically appear, they are performed by the copy constructor.
 
yeah but what I'm trying to get is why does invoking the copy constructor on y, invoke another copy constructor?
Copy constructor is called to copy y
 
@LewsTherin Because the copy constructor is used for passing arguments by value.
 
Whenever you see a function foo(T z), the copy constructor will be invoked to initialize z. Right? So if the copy constructor had the signature T(T z), that z would also have to be initialized by calling the copy constructor before the body of the copy constructor could be entered -> infinite recursion
 
8:31 AM
Say, don't you need sleep anyway?
 
Except it's not infinite recursion in the familiar sense that causes stack overflow, it's more like the compiler can't even begin to produce code to do it. It just doesn't know where to start.
The compiler says, "I want to call the copy constructor. Well, first I'll need to call the copy constructor. So first I'll need to call the copy constructor. Huh."
 
so at first 2 copying makes place
A copy of y, then when it attempts to initialize that copy with z, it invokes the copy constructor which needs to initialize z it calls t again
 
Except, critically, it never faces that problem because the language forbids you to write it in the first place.
 
@Potatoswatter I'd put it that way: it's an infinite recursion in brainspace, the space where language is conceived. It's not a recursion in the language space, we're not quite there yet.
 
@Potatoswatter Actually, the compiler doesn't really say that. T::T(T) is simply not recognized by the language as a copy constructor.
10 mins ago, by FredOverflow
> A non-template constructor for class X is a copy constructor if its first parameter is of type X&, const X&, volatile X& or const volatile X&, and either there are no other parameters or else all other parameters have default arguments. [12.8 §2]
 
8:33 AM
x(y) -> Invokes T(T z) to create 'x'. Because z is a value parameter we must first copy y into z (using the copy constructor) so this invokes T(T z) to create 'z'. Because z is a value parameter we must first copy y in z1 (using the copy constructor) so this invokes T(T z) to crate 'z'. Becuase z is a value parameter we must first copy y into z2 (using the copy constructor......
 
@FredOverflow Not only that, T::T(T) is required to be recognized as an entirely invalid signature.
10 mins ago, by Potatoswatter
@FredOverflow Not only that, but it's illegal to declare a "copy constructor" with argument type X. (12.8/6)
 
@Potatoswatter Sure, since it's neither a constructor nor a (normal) member function.
 
Are we getting anywhere?
 
@TuxD I got that explanation thanks..that's what I was trying to see
But why does an assignment operator not call it?
like jack = sam after initialization
 
@FredOverflow If it weren't for the explicit exclusion of 12.8/6, it would syntactically be a constructor.
 
8:36 AM
@Potatoswatter Yes, and if C++ had reference semantics and Garbage Collection, Java would probably never have been invented.
 
@LewsTherin Depends how it's declared. If the assignment operator uses pass-by-value then the copy constructor sure is called, as it would be for any other function. (That's used for copy-and-swap for instance.)
 
This link ha a quote
Person q("Mickey"); // constructor is used to build q.
Person r(p); // copy constructor is used to build r.
Person p = q; // copy constructor is used to initialize in declaration.
p = q; // Assignment operator, no constructor or copy constructor.
 
> Depends how it's declared.
 
p=q ... ? that is copying q into p ?
 
cpx
I thought copy constructor is used to pass by const reference not by value, is it correct or am i missing something here?
 
8:37 AM
@cpx missing
 
@LewsTherin For class types, p = q is just syntactic sugar for p.operator=(q).
 
So that calls = function if it is declared then
 
The important distinction is that p already exists before the assignment. Whereas in the T p = q; case, it does not.
@LewsTherin The compiler implicitly declares it for you if you don't provide it.
 
anyway, why is ADL not defined so as to also deal with explicit specialization?
 
@FredOverflow ah cool I see that.
 
cpx
8:40 AM
@AlfPSteinbach hint?
 
So in this T p = q ; can either use a copy constructor or assignment operator
 
Also it means all my 'ADL-friendly' tuple using functions can't deal with anything else than std::tuple.
 
@LewsTherin No, it cannot use the assignment operator, because p doesn't exist yet.
 
@cpx pass by value is defined as copy initialization
 
@AlfPSteinbach Huh? Those are orthogonal. ADL finds the template declaration, which includes all explicit specializations.
 
8:40 AM
@LucDanton yeah I need to sleep...got a splitting headache
 
@LewsTherin I hate those :(
 
@Potatoswatter well i think it would be nice if they were very orthogonal, but not for Fred's case
 
@LewsTherin If q is of type T, then T p = q; and T p(q); are almost equivalent. There is a small difference, but I forgot what it is. Anyone?
 
@FredOverflow, ok I see that makes sense. THanks
 
4
A: getting an element from a tuple

NawazIt's because you attempt to explicitly instantiate get function template, by providing 0 as template argument. In case of templates, ADL works if the template is instantiated implicitly, by template argument deduction. Please note that it is the explicit instantiation of template which fails. I...

 
8:41 AM
@LucDanton tell me about it..especially migraines...I get that a lot
 
@AlfPSteinbach Where's Fred's case? Usually if you want ADL you should overload instead of specialize.
 
did i write specialization?
i did
 
How does one do additive blending?
 
Yeah, I don't understand how GCC is compliant there. Since tuple and get are both std it should work :v( . Ah, and now I've read the answer and I understand, for better or worse.
 
i just meant "instantiation".
 
oh my god, that looks crazy
 
@Potatoswatter I'd look up ADL rules to see what's going on but as I recall those are a bitch to find and understand. So waiting on a hero to do it for me :)
 
i am using allegro
 
0
A: getting an element from a tuple

X-IstenceThe get function is defined in the namespace of std. Since you don't have a using namespace std; in your code the compiler doesn't know what get<>() function you are calling. By adding std:: as a namespace declaration in front of it the compiler can find the function and use it.

using namespace std; lol
 
@LucDanton Short answer: The problem is that ADL finds a set of function and function template names.
 
8:44 AM
http://alleg.sourceforge.net/a5docs/refman/graphics.html#al_set_blender
What actually happens with the calculation
 
@Potatoswatter Go on.
 
If presented with a template-name, then a set of template-names is required. That's not what ADL finds, so ADL is not used. LOL
 
@LewsTherin And what makes you think we are allegro experts? :)
 
@Potatoswatter Interesting.
 
@FredOverflow All of you seem to pretty much know everything :P
 
8:45 AM
Yeah, can't parse our way out of this.
 
4 mins ago, by FredOverflow
@LewsTherin If q is of type T, then T p = q; and T p(q); are almost equivalent. There is a small difference, but I forgot what it is. Anyone?
Oh yeah, now I remember. T p = q; doesn't work with explicit constructors, right?
 
actually checking the standard my term "specialization" was correct, and nawas' "explicitly instantiate" is wrong. but who remembers all these term definitions.
 
@FredOverflow Correct.
 
What do you mean explicit constructors?
 
Also doesn't work with explicit conversion operators.
 
8:46 AM
the constructor we define?
 
T::T(int);            // non-explicit constructor, allows T x = 5;
explicit T::T(int);   //     explicit constructor, does not allow that
 
explicit is actually keyword?
 
The terms are copy initialization vs direct initialization (the first term still applies if overload resolution picks a move constructor -- this is at the syntax level).
 
@LewsTherin Yes, it was invented by Bjarne to forbid implicit conversions on one-argument constructors.
 
@FredOverflow in c++03 the T p(q) is a direct initialization, and T p = q is a copy initialization. The latter requires an accessible copy constructor.
 
8:48 AM
@LewsTherin Yeah, I thought that was amusing as a kid. "Warning: explicit language."
 
@FredOverflow C++ has so many stuff lol
@Potatoswatter that's funny xD
 
@AlfPSteinbach So it doesn't matter if it's explicit or not?
 
it matters because an explicit (non-default) constructor cannot be implicitly invoked
that's the whole point of explicit
and it matters for e.g. declaring a std::ostringstream:
std::ostringstream stream( s );  // OK
but
std::ostringstream stream = s;  // No no no.
 
No3x
did anyone actually get that? Aww, nevermind then
 
@FredOverflow no, explicit wasn't Bjarne's work. it was some other guy. whom i got into a little flame war with. I can't recall his name?
he's here on SO I think
 
8:53 AM
@LewsTherin Oh, I just noticed the heading: 9.11 — The copy constructor and overloading the assignment operator. Coincidence?
 
cpx
@AlfPSteinbach I see, i thought we were talking about the parameter of copy constructor, which takes a const reference.
 
@FredOverflow I don't think so.
Copy constructor to copy object on object creation...
But since assignment doesn't call a copy constructor we need to overload assignment operator
I think I am getting it
 
@AlfPSteinbach Nathan Myers?
 
@LewsTherin This FAQ may be helpful to you:
65
Q: What is The Rule of Three?

FredOverflowWhat does copying an object mean? What are the copy constructor and the copy assignment operator? When do I need to declare them myself? How can I prevent my objects from being copied?

> The initialization person b(a); is performed by the copy constructor. Its job is to construct a fresh object based on the state of an existing object. The assignment b = a is performed by the copy assignment operator. Its job is generally a little more complicated, because the target object is already in some valid state that needs to be dealt with.
 
8:56 AM
Why doesn't Mono have any plans to make a cross-platform version of WPF?
 
it was a very silly flame war. Nathan stated that you couldn't wrap a C header in a namespace. I responded by actually doing that for <windows.h>. Of course we were talking about two entirely different things :-). But neither of us understood that. Or at least I didn't.
 
@FredOverflow thanks
 
@LewsTherin I should probably have thought of that earlier :)
 
I am sorry, I would have asked it in the C# room, but everyone there is dead .
 
@AlfPSteinbach Wait, you were already an active C++ programmer at the time explicit was invented? Cool.
 
8:57 AM
xD, it's OK.. as long as you did in the end :P
 
@IntermediateHacker Not dead yet, still waiting for Garbage Collection...
 
@FredOverflow Lol.
 
@IntermediateHacker It's highly unlikely anyone here is proficient with Mono and WPF.
(I don't even know what "WPF" stands for.)
Developed by Microsoft, the Windows Presentation Foundation (or WPF) is a computer-software graphical subsystem for rendering user interfaces in Windows-based applications. WPF, previously known as "Avalon", was initially released as part of .NET Framework 3.0. Rather than relying on the older GDI subsystem, WPF utilizes DirectX. WPF attempts to provide a consistent programming model for building applications and provides a separation between the user interface and the business logic. It resembles similar XML-oriented object models, such as those implemented in XUL and SVG. WPF employs X...
ok now I know
 

« first day (330 days earlier)      last day (4620 days later) »