« first day (459 days earlier)      last day (4472 days later) » 

7:00 PM
One with high precedence, and one with low precedence, with composition sitting in the middle.
 
@sbi gorilla makes me angry
 
Yeah, like Haskell
 
sbi
@rubenvb Why?
 
you make me dupe vote non-dupe questions
 
sbi
17 mins ago, by WTP'--
dupevote http://stackoverflow.com/questions/8915501/what-is-going-on-in-this-piece-of-c-code-resolution-operator-with-inheritanc/
Note who asked you.
 
7:01 PM
lol
 
@sbi Oh, I was misled by the "inheritance" part, thinking it meant the colon.
 
sbi
@RMartinhoFernandes Well, I now think that he also asked about that. :(
 
@sbi the accepted answer pretty much sums it up. The question is really unclear
 
one of the best talks I watched recently
By the way, there are no C++ compilers for the Commodore 64, are there? :)
 
7:03 PM
hehe
 
C++64, that would be cool :)
 
I think it's possible.
 
sbi
@rubenvb I think he just doesn't know much of C++, and is confused both by the syntax for a member function definition out of class and by the member initialization list.
 
@sbi indeed, understandable question.
 
sbi
So would you guys please revert the mess you have made and reopen that question? // @Als, @Jerry, @RMartinho, @ruben, @WTP
 
7:09 PM
@sbi Isn't it "more or less" an exact duplicate?
 
sbi
@FredOverflow No, it's only a partial dupe.
 
@sbi already done
SFINAE gone bad:
M:\Development\Source\KISS\include/tmp.hxx:48:5: error: no type named 'type' in
      'kiss::__implementation::enable_if<false, long>'
    using enable_if = typename __implementation::enable_if<Condition, T>::type;
    ^~~~~
M:\Development\Source\KISS\include\math.hxx:191:26: note: in instantiation of
      template type alias 'enable_if' requested here
    template<typename T> kiss::enable_if<is_integral<T> && sizeof(T) < ...
                         ^
M:\Development\Source\KISS\include\math.hxx:192:15: note: while substituting
 
typedef void func(void);
func* f = (func*)0xdeadbeef;
f();
I prefer this style when declaring function pointers.
i.e. typedef a function type, and a use pointers to that, instead of typedefing the function pointer directly.
Avoids those annoying (*) things.
 
@RMartinhoFernandes What's the magic number for vegetarians?
 
@RMartinhoFernandes I prefer std::function
 
7:14 PM
@rubenvb When declaring function pointers? That's weird.
 
@RMartinhoFernandes I don't like function pointers
or bare pointers in general. Function pointers, I stuff in a std::function
 
@rubenvb Just because of the weird syntax? Come on, this is C++ we're talking about!
 
Well, you can't cast bare naked addresses to a std::function.
 
Bare naked addresses? Isn't that a band or something?
 
sbi
This question is still missing two votes to reopen.
@FredOverflow Addresses aren't ladies.
 
7:16 PM
Hehe.
 
This ain't working: ideone.com/oju3o
@RMartinhoFernandes ^ it's your alias template sugar
 
@FredOverflow Dunno, 0xBADF00D.
 
My SFINAE's turned into SFIAE
5
 
Ambiguous overloads?
 
sbi
7:19 PM
@RMartinhoFernandes Interesting. I hadn't even known this works. Can I copy that for my answer?
 
@sbi Sure, go ahead.
No attribution required.
@ruben if it's ambiguous overloads, it's because you have two templates enabled simultaneously.
template<typename T> constexpr T abs(const T x)
template<typename T> kiss::enable_if<is_integral<T> && sizeof(T) < sizeof(int),T>
constexpr abs(const T x)
These will both get picked for abs(char(0)).
 
ah yes
maybe just dump the second one
 
You need to disable one.
 
makes it all prettier
thanks
 
sbi
@RMartinhoFernandes Too bad, I already referenced your message. :)
 
7:23 PM
Well, it feels good to teach something to a grumpy old man like you :) C++ is awesome.
 
sbi
Folks, this erroneously closed question still requires two votes to be reopened.
 
@sbi why is it closed erroneously?
 
sbi
@RMartinhoFernandes Ha, many of you can teach me a lot of stuff. I haven't written C++ for a living in years, I totally missed out on C++11, and I could never make myself reading the standard, so I lack a lot.
 
is there any official/unofficial release date for visual 2011 ?
 
sbi
@TonyTheLion Because five users mad a mistake? :)
25 mins ago, by sbi
@WTP I think it was wrong closing this. I think this was asking about orange::orange() ("resolution operator"), not about member initialization lists. I don't doubt that there's a dupe for this one, too, but this isn't it. // @Als, @Jerry, @RMartinho, @ruben
 
7:24 PM
It's sometime this year.
 
sbi
@Guillaume07 I doubt there will has been was a VC2011.
@RMartinhoFernandes Last year, you mean, Shirly?
 
VC 2012
perhaps
 
^probably
 
@sbi really ???
 
@sbi Oh, well, it's VS11.
 
7:26 PM
my life is a mistake.
 
It just happens to be VS 2012 as well.
 
ok yes VS 2012 I a little bit in trouble with date and visual studio title
 
AFAIK there's no official release date yet.
 
all right
 
sbi
@Guillaume07 VC6 == VS6; VC7 == VS.NET; VC7.1 == VS.NET 2003; VC8 == VS2005; VC9 = VS2008; VC10 == VS2010; VC11 == VSnext. I suppose "VSnext" will be re-Christianized before release.
 
7:29 PM
Great, confuse the hell out of him.
Also, why are you assigning to VC9? ;)
 
I had no idea that operator() is also called the "application operator", TIL
 
sbi
@RMartinhoFernandes There never was a VS9. Well, at least not according to MS' marketing babble.
 
Why does the second version work for floating point types? pastebin.com/ZtedV7rt
 
@sbi thanks
 
ah yes, through the following is_arithmetic thing
nvm
 
7:31 PM
@sbi Well, VC9. You're still assigning to it.
And yes, I did wait for the edit window to expire before replying :P
 
sbi
@RMartinhoFernandes Shrug. (BASTARD!)
 
hmm, won't the normal T(-1)<T(0) also work for floating point types?
 
why?
float(-1)<float(0), right?
 
7:34 PM
Oh, I guess so.
 
Tin
@rubenvb, sorry, i didn't understand your question. what did you ask for?
 
For a moment there I was considering unsigned floating point types...
Nevermind.
 
int a,(*b)(); This must be the evilest declaration I've seen recently on SO.
 
user142019
@sbi whoops D:
 
7:36 PM
@RMartinhoFernandes naiis
 
@sbi The "about" box on my copy says "Visual Studio 2008\nVersion 9.0.30729.1 SP"
 
sbi
@JerryCoffin I know. That's why I said "...at least not according to MS' marketing babble." I just thought that message is confusing enough as it is...
 
Tin
@rubenvb, mmm, it's not so clear to me as well
 
If you have a type Ptr on which you have overloaded operator->(), then what does this do: void g(Ptr p) { X* q = p.operator->();} ? Unless this operator overload does something else then what's it's use is normally for, this seems a strange use of it, although it's perfectly valid.
 
7:44 PM
-9
Q: this is my assignment and i need help please .. ?!

HishamAnswer each of the following questions: The Unsorted List ADT is to be extended with a Boolean member function, IsThere, which takes as a parameter an item of type ItemType and determines whether there is an element with this key in the list. a. Write the specification for this function (i.e.,...

This was some quick closing action.
 
sbi
> Actually, the real tricky difference between struct and class is that the latter can be used in place of a typename to declare a template parameter, while the former cannot. :) — sbi
 
@TonyTheLion It gives you the result of operator->(), without accessing any member.
 
@RMartinhoFernandes so I guess that would normally a pointer to the object?
 
Looks like a hack to get the internal pointer out of a smart pointer.
 
@RMartinhoFernandes oh, like get()
 
7:48 PM
operator-> is a strange beast.
Jan 6 at 0:01, by R. Martinho Fernandes
a->b may be transformed into a.operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->().operator->()->b
 
a->b will look for operator-> and then look again for it on the return type of that, and on and on, until it finds a pointer.
After reading this question and the answers stackoverflow.com/questions/8916283/… I've decided some more details about Hell++.
When you do new T[N], the N is not stored before the array, like is common.
The N is stored at the end of a linked list full of garbage.
What is stored before the array is a pointer to the start of that list.
 
@RMartinhoFernandes huh, I swear I read that exact same Q a few days ago
 
Ell
arghh silly winapi program...!
for some reason the window border isnt shown until I minimise it and show it again o.O
 
Ell
8:17 PM
hmmm why do i get nullptr is not recognised or whatever?
I have the flag --std=c++0x
using tdm-mingw4.6.1
 
Maybe you made a typo?
 
sbi
@RMartinho: Could you have a look at this C# question I asked over in the C# room?
Or anyone else knowing a bit of C#, really.
 
Ell
I get symbol could not be resolved, not "not declared in this scop
 
Are you trying to use nullptr or nullptr_t?
@sbi I'm on it :)
 
Ell
errrm "NULL" :P
what am I supposed to use? o.O
 
8:21 PM
Oh. You need to #include something.
<cstdlib> I think.
But you can just use nullptr.
 
sbi
@RMartinhoFernandes Yeah, I know. And you already know that I know. And I know that you know that I know. And that, you know, too. :)
 
Ell
whats what I'm trying but I get symbol not resolved but I think its somthing to do with eclipse
it seems to work fine with a test file on the command line
 
@Ell you'll need -std=c++0x, one dash
 
Ell
oops
hmm... still doesn't work
myserious
how bad is #define nullptr 0 until I get it working?
 
That's the same as NULL.
 
Ell
8:33 PM
yeah but
when I get it working
i can just get rid of the macro and it will work?
 
Vote for your 'project of the month' candidate
Boost C++ Libraries is in the list :)
 
Ell
yayyy i fixed it!
and what is boost++?
oh
i thought it was different to boost libraries
 
sorry for the sloppy spelling there. I got owned by the chat editig too :)
 
Ell
:L
is fullscreen down to windows or opengl? o.O
 
Ell
8:46 PM
okay :D
 
> No screenshots and Introduction is not very clear. at least explain what is this for, why we use this, and what are the advantages and disadvantages, why we use this over something else.
lol, comment on Boost on SourceForge.
 
Ell
lols
 
screenshots of boost?
 
evening
 
Xeo
0
A: Should this compile? Overload resolution and implicit conversions

XeoIt should be easier to picture why the overload resolution is ambiguous by going through it step-by-step. §13.5.5 [over.sub] Thus, a subscripting expression x[y] is interpreted as x.operator[](y) for a class object x of type T if T::operator[](T1) exists and if the operator is selected as th...

 
Ell
8:48 PM
evening :)
 
Xeo
I seem to like overload resolution as a topic.
It's an extremely interesting and complicated part of C++
 
3
Q: Why is arr and &arr the same?

ragnarius Possible Duplicate: Is array name a pointer in C? I have been programming c/c++ for many years, but todays accidental discovery made me somewhat curious... Why does both outputs produce the same result in the code below? (arr is of course the address of arr[0], i.e. a pointer to arr[0]...

This is not a dupe.
At least not of that one.
 
@Xeo I haven't bent my mind around it yet
but it looks interesting
 
No, it's not interesting. It's maddening.
Just look at @Xeo.
Do you really think he's sane?
 
are any of us?
 
8:54 PM
Not relevant.
 
lol
 
Xeo
7
A: How do I determine if a type is callable with only const references?

XeoAfter hours of playing around and some serious discussions in the C++ chat room, we finally got a version that works for functors with possibly overloaded or inherited operator() and for function pointers, based on @KerrekSB's and @BenVoigt's versions. #include <utility> #include <type_...

> (Yes, I think the idea is stupid. Yes, I still went and built this. Yes, it was fun, very much so. No, I'm not insane. Atleast that's what I believe...)
 
@Xeo I was about to go and bring that up as evidence.
Thanks.
 
@RMartinhoFernandes oh lol, guess you've at least attempted understanding it?
 
@TonyTheLion I have a vague idea of it. If the compiler throws some error I disagree with, I bring it to this room.
 
Xeo
8:56 PM
overload resolution is still hella complicated and over my head
 
But most of the time the error is my fault, and the compiler errors are enough for me to engineer a fix.
 
In this book I"m reading there's a basic description of what is done, that isn't too hard to understand
 
@TonyTheLion C++ Templates: The Complete Guide?
 
Xeo
If only for the fact that the overload resolution section of the standard cross references itself all over the place
 
@RMartinhoFernandes No, "The C++ Programming Language, Special Edition"
 
8:58 PM
But there's hardly anything worse than an overload ambiguity over operator<<.
The compiler tries really hard to bury you under all the candidates.
 
oh yea
had that before
 
> I know that and array, when type casted to an int, has the same value as the address of the first element. But this was not my question..
WTF.
 
surprise: people don't know wtf they're talking about w.r.t arrays
 
Guy asks why the value of decayed arr (i.e. address of arr[0]) is the same as &arr.
And then this.
 
I call for "muppet-routine"
 
9:03 PM
What's that?
 
it's where you go on a screaming rant about how the OP has no idea what he's talking about and that he's essentially a muppet
basically, I've just invented this routine. :P
 
lol
@TonyTheLion Well, I really am starting to think that.
He also complained how the address of two separate struct members was not the same.
I'm not sure I want to know what inane reason would cause that idea to form.
 
@RMartinhoFernandes just not really understanding the rules of the language and programming, would be my guess
people have this tendency to make things up to substitute for things they don't understand
I've never seen this void h() &; what is that? a function that returns a reference to void???? WTF
 
That's C++11.
It's a ref-qualified function.
It can only get called on lvalues.
It's likely that there is an overload with &&; nearby.
 
yep
so you couldn't call h() on some temporary of it's object?
not even sure how you'd call a member function on an rvalue???
 
9:11 PM
You could, but it'd call the overload with the && qualification.
T().h()?
 
duh...
 
Xeo
22
A: What is "rvalue reference for *this"?

XeoFirst, "ref-qualifiers for *this" is a just a "marketing statement". The type of *this never changes, see the bottom of this post. It's way easier to understand it with this wording though. Next, the following code chooses the function to be called based on the ref-qualifier of the "implicit obj...

 
@TonyTheLion std::string("hello").length() is calling a member function on an rvalue.
 
Ell
is anyone here french?
or can speak french?
and is willing to help me with my french homework?
 
Xeo
@Ell Je ne parles pas francaise.
 
9:15 PM
@Ell French is my first language.
 
Comment allez-vous?
 
Ell
Actually its unfair - it's not the French I'm stuck on... its the actual content :O
 
Voulez-vous couchez avec moi?
Qu'est-ce que c'est? // <-- this is really French, not Klingon
 
Ell
I write in english then translate. But I have so little concentration I can't even write in english :O
 
@FredOverflow Je sais.
 
Ell
9:17 PM
"Kes-ker ker-say"
 
@Ell One "ker" too much, it's only three syllables.
 
Ell
"oops
"Kes-ker-say"
:D
@FredOverflow it was a typo, I promise :D
 
You typed four keys by mistake? :)
 
It doesn't end in ay.
 
It's not really "ker". In fact the "r" is not supposed to be there.
 
sbi
9:19 PM
Really, This room is popular. Now it's users without a single upvote for a C++ answer coming here and asking for help with their French homework. We should get a collective Legendary badge.
10
 
"c'est" ~= "say". For sound, I mean.
 
That's Englishized French.
@EtiennedeMartel I guess you Canadians speak either English, French or both with a weird accent.
 
@Xeo thanks. Upvote given! :)
 
Ell
I have to go because my stupid brother guy is being a gay silly poopoohead! Au revoir!
 
@RMartinhoFernandes Not really. French is mostly spoken in Quebec. The rest of Canada is mostly English-skeaing.
 
9:21 PM
@sbi It's true. You wonder what makes anyone think they can get help with their French in a C++ room??? Where the association? Bjarne wasn't French...
 
Well, if "c'est" ~= "say" in Canada, your accent is not at all like European French.
 
Brain teaser time!
 
@TonyTheLion I think it's the friendliness.
 
Im tryint to assign the largest value in an array a different specified value (in this case 40)
 
@EtiennedeMartel Wow, you think we're a friendly bunch??
2
 
9:22 PM
@RMartinhoFernandes Well, it's not really equal. Hence the ~=.
@TonyTheLion I still haven't been impaled with a lamppost yet.
 
And then assign all each descending element (40 - that element)
 
what is ~=? I dunno such operator
 
@EtiennedeMartel yea I think so
 
sbi
@TonyTheLion Actually, these are Ok with me, as long as they don't get out of hand (as those Haskell fanatics managed to do). I'm just shaking my head. (I'm not bashing you, @Ell.)
 
@mwmnj if you google "max algorithm", you'll get somewhere
 
@RMartinhoFernandes In fact it's not "ay", more like "eh".
 
Tony The: ok thanks!
 
@EtiennedeMartel Ah, that's more like it.
 
@sbi oh someone mentioned Haskell?? (Wonder who that was?? :P)
 
9:24 PM
Oh, surprise! Perl 6 doesn't have ~=.
Dammit.
 
sbi
@RMartinhoFernandes Wow. Just. Wow.
 
@mwmnj use std::solve_my_problem
Lua have ~= (AFAIK) but it's C++ room
 
Wait, it actually has. It's done with a metaop!
 
Abyx: you dont think magic.h would work better?
 
9:25 PM
this is valid void h(int()); as a function declaration?
 
Yes.
It's a function that takes a function.
 
supposedly that's just a function pointer returning an int
 
sbi
@TonyTheLion MVP.
 
@mwmnj magic.h is C, use <magic>
 
@sbi ???
 
9:25 PM
@awoodland With an interface entirely in English.
 
Jeez, I thought I knew something about C++, turns out I know jack shit
 
@TonyTheLion Miss Valery Pierce.
 
@Abyx Yes, but it's just != with a different syntax
 
@EtiennedeMartel true some localisation would be useful
 
sbi
@TonyTheLion
 
9:26 PM
@TonyTheLion I prefer to speak to Jack Fuck, he's a more flexible guy
 
@awoodland In fact, French.SE is also in English. Stack Overflow is hardcoded in English.
 
@DeadMG lol
 
Perl 6's ~= is string concatenation + assignment.
 
@sbi oh yes, that
@RMartinhoFernandes WTF???
 
three-letter-acronym
 
9:28 PM
@TonyTheLion Don't tell me you expected a sentence starting with "Perl" to make sense.
 
there's a few more ascii char's they've not used as operators in perl, so perl 7 ought to be good
 
Also, dammit, dinner. Bye.
 
@RMartinhoFernandes euh, no
 
Hey guys! Anyone knows how to connect to a virtual machine using ssh with VirtualBox?
 
lol
 
9:32 PM
Hey guys
 
@ManofOneWay did you setup your networking properly with VB?
 
Does anyone know what Chris means here
2
A: Why is -INT_MIN = INT_MIN in a signed, two's complement representation?

ChrisThe missing digit is 0. In a mathematical sense, 0 is neither positive nor negative. But in a binary sense, since 0 has no negative bit, it's considered positive. In other words, if you wanted -128 to 128, there couldn't be a 0.

if you wanted -128 to 128, there couldn't be a 0.
Any ideas?
 
with 2^8 possible values
 
it's range - [-128, 128]
 
Xeo
@LewsTherin [-128, 128] is 257 elements if you include 0, which will not work with 8 bit, since 2^8 == 256
 
9:34 PM
you have to have one more on one side of 0
 
Can we work with 3 bits to make things easier to understand?
Why remove 0? What if we remove 128?
 
void f (int i, int j);
void f (int i, int j = 99); // OK: redeclaration of f(int, int)
void f (int i = 88, int j); // OK: redeclaration of f(int, int)
 
you're not removing 0
 
How can this redeclaration be ok?
 
you're adding a sign bit
and not having -0 and +0 as distinct things
 
Xeo
9:36 PM
@TonyTheLion @Johannes once asked a question about it
 
@Xeo have a link?
 
@TonyTheLion default values are not part of signature
 
@awoodland Yeah
 
@Abyx yes, indeed, so then that shouldn't be allowed, although it say, "OK"
 
@LewsTherin so the question is which side of 0 are you going to put that extra thing?
 
Xeo
9:37 PM
28
Q: Default argument in the middle of parameter list?

Johannes Schaub - litbI saw a function declaration in our code that looked as follows void error(char const *msg, bool showKind = true, bool exit); I thought first that this is an error because you cannot have default arguments in the middle of functions, but the compiler accepted this declaration. Has anyone seen ...

 
@awoodland Agh, damn too slow. Why is the 0 affected?
 
@LewsTherin ignore numbers altogether for now. If we have 2 bits that gives 4 possible states right? 00 01 10 11
 
@awoodland Yeah
 
so now we assume it's binary and say 00 = 0 in decimal and 11=3 in decimal
(and the same for 10 and 01 in between)
and now we have to have negative numbers
 
9:40 PM
so we add a signed bit
 
Haha my first C64 program in like 10 years :)
 
which says is it positive or negative
but now we have 8 "things", which under that system get labelled -3, -2, -1, -0, 0, 1, 2, 3
 
@awoodland SFSG
 
but that's crazy because nobody things in -0/+0
so we're going to say we can use that "thing" to be a bit more useful
 
@Xeo ah, but only in declarations, not the definitions. I guess it can still only have one definition, right?
 
9:42 PM
Wait hold on
 
and not make any -/+ distinction on 0
 
@awoodland Where do you get these numbers from? I thought it was 2 bit?
 
it was 2 bits and then I added a sign bit
so we could say if our 2 bit number was positive or negative
 
@awoodland Why does adding a sign bit increase the range? I'm confused. The number of digits is still 2
 
it hasn't increased the range
 
9:44 PM
Oh I see
 
it's just allowed us to have a positive or negative version of the 2 bit range
 
@awoodland Yeah, sorry.
 
so now we've got this crazy system with two ways of having 0
so we want to "erase" one of the 0s
and lets just say we're only going to have one 0 in the system
but we've still got 2^3 possible things
so if we removed the -0 for aguments sake
we'd want to move everything to the right by one
but we then have 7 things represented by 3 bits
so the sensible thing to do is to use that extra thing that we freed up from removing the second representation of 0 for another number
rather than have it "invalid" or duplicated in some way
in actual fact two's complement arithmetic is common because it has some handy properties
 
If we removed -0 how would it be duplicated in some way?
 
removing -0 and so only having +0 is removing the duplication
 
9:50 PM
Oh right that's what you meant*
 
How many of you use continuous integration for your c++ code?
 
but your choices when you add a sign bit are a) allow -0 and +0 to co-exist, b) have something "wasted" by being an illegal bit pattern or c) make the range asymmetric
@mantler nothing that formal for me
 
@awoodland So what's the choice taken? c?
 
@awoodland but you use some kind of automated build system? Do you do any unit testing?
 
@mantler I unit test sometimes, but I'm more crude than that usually
it's manual when things get built and deployed, but (for some projects) it happens frequently enough that at some resolution it's continuous :)
 
9:53 PM
@awoodland Ok. :)
 
@LewsTherin yup, but it's taken through two's compliment arithmetic which makes addition and subtraction work nicely with the sign bit for free
 
I was just wondering how widely used it is in c++. I use it at work in c++.
 
@mantler what system do you use for it?
 
@awoodland We use Jenkins. Have the tests in boost test framework.
it builds the source on each commit. Can deploy (to a zip) with a button. That final step is worth the whole setup procedure :)
 
@awoodland thanks lec
 
9:57 PM
@awoodland only thing we are not happy with is how our dll's get versioned and "rebuilt" sometimes.
Since we have many dll's and if we want to produce a certain version that does not require the HEAD from repos. Then it is still some work.
 

« first day (459 days earlier)      last day (4472 days later) »