« first day (584 days earlier)      last day (4356 days later) » 

12:02 AM
I never had such troubles with it
 
Xeo
older versions of MSVC relied heavily on doing many things in its GUI thread, so...
 
@stdOrgnlDave ever work with a solution that had 120+ projects?
 
Xeo
Why can't you use VS10 or 11 anyways?
 
@Xeo work
 
Xeo
Is that really an excuse? VS10 express should work just fine, or what am I missing?
No, nevermind the first part
 
12:07 AM
@Xeo VC10 won't open VC9 solutions without migrating them, at which point I no longer get the changes done to the old solution. So I can't do it on my own machine (for much). And the company hasn't paid for VC10 yet. Money's tight.
 
Xeo
VC10 express for everyone! :)
 
@MooingDuck have you rebuilt your intellisense file yet?
 
hello guys
 
oh son of a.... My function only accesses the array if it the index out of bounds. How did nobody notice this in the last four months?
 
if you force VC9 to rebuild its intellisense you might get better performance
 
Xeo
12:08 AM
@MooingDuck What the...
 
I am kindof desperate, can I ask you a question please?
 
Xeo
Flipped comparision?
@AhmedJolani If it's got to do with C++, yes.
 
of course..
 
Xeo
@AhmedJolani I wouldn't be so sure about that
Don't ask how many Java question we get in here..
Just because the Java room is dead
 
@Xeo yes
 
12:10 AM
no I grantee..
 
Xeo
Well then, shoot.
 
@stdOrgnlDave seems unlikely for a project this big. It's been slow since I started.
 
I feel like an idiot in C++, I wanna be an expert also production what should I do? long question I know, but I am so desperate :(
 
@MooingDuck did you import the intellisense file that came with the project or did it generate its own on your compy?
 
Xeo
VS11 does wonders WRT performance of big projects
 
12:10 AM
peoductive *
 
@AhmedJolani books are good
 
give reference please
 
Xeo
@AhmedJolani Nobody's an expert in C++.
 
I am off the basics, I want an advance
 
Xeo
1155
Q: The Definitive C++ Book Guide and List

grepsedawkThis question attempts to collect the few pearls among the dozens of bad C++ books that are released every year. Unlike many other programming languages, which are often picked up on the go from tutorials found on the Internet, few are able to quickly pick up C++ without studying a good C++ book...

@AhmedJolani If you feel like an idiot in C++, I wouldn't trust that you're out of the basics
 
12:12 AM
Can you test me now please?
 
@AhmedJolani make simple programs. Then answer SO questions.
 
Xeo
I'm not a teacher
 
I made a socket programs, but don't know my level..
socket programs*
 
OK @AhmedJolani I will test you
 
12:12 AM
@RMartinhoFernandes is going to be furious
 
Xeo
@AhmedJolani You can edit your messages by hitting the up arrow
 
@AhmedJolani if you have the basics, start answering SO questions. As people correct your answer, you will learn a lot.
 
ah ok
 
Xeo
For up to 2 mins, anyways.
 
I am, but getting sometimes down votes
 
Xeo
12:13 AM
I advise you to read the newbie hints linked on the right if you want to survive in here.
 
@AhmedJolani Did they say why? If so, then you learned something. Keep it up.
 
@AhmedJolani why won't this code compile ideone.com/I2j0G
 
sometime yes, othertimes no, so that I wanna expand my knowledge
let me check please
 
Xeo
@stdOrgnlDave lawl
 
@Xeo :-D
 
Xeo
12:15 AM
Wait, is that yet another version?
@MooingDuck Look closely
 
@stdOrgnlDave you are trying to use an operator that has not been overloaded.
 
no this is the one that works on VC but not clang or GCC. it's the vexing one that shouldn't compile but does on VC. by the way I figured out why MSVC compiles it and the other one does
@AhmedJolani the template overloads operator<
 
@stdOrgnlDave there's two bugs in there >.< and I fell for one.
 
@MooingDuck is the second one run-time recursion?
 
Xeo
12:17 AM
@stdOrgnlDave Yes, I told you why :P
 
@stdOrgnlDave I dislike that operator, that's just confusing
 
@Xeo it's not as simple as "Microsoft is lax about it," I believe they do operator overloading fundamentally differently
 
Xeo
It's not "lax", it's "wrong"
 
so this is the answer "no this is the one that works on VC but not clang or GCC. it's the vexing one that shouldn't compile but does on VC. by the way I figured out why MSVC compiles it and the other one does"?
 
Xeo
And definitly a bug at that, I thought we sorted this out last time?
 
12:18 AM
no that isn't why it doesn't compile
 
@Xeo not sure if we did, let's wait until this is over
 
actually the auto keyword is new to me.
 
@Xeo last I knew we didn't know why MS did it
 
would you advise reading cplusplus.com tutorial, I read it but stopped on the templates?
 
12:20 AM
@AhmedJolani I am happy to see that you readily admit your ignorance. this is a pretty tough question even for people who are intermediate at C++11
no, I would not advise cplusplus.com tutorial
 
Xeo
@stdOrgnlDave Bug. I had a few testcases that all showed that the const was only ignored inside decltype
Or something like that, anyways
 
@stdOrgnlDave his answer was correct though
 
@Xeo oh you didn't share them. really? wow
 
Xeo
Can't exactly remember
I did?
 
@MooingDuck which answer is that?
@Xeo last I knew you said it was just something that was weird about MSVC operator overloading
 
Xeo
12:21 AM
This is going to be tough to find
 
10 mins ago, by Xeo
1155
Q: The Definitive C++ Book Guide and List

grepsedawkThis question attempts to collect the few pearls among the dozens of bad C++ books that are released every year. Unlike many other programming languages, which are often picked up on the go from tutorials found on the Internet, few are able to quickly pick up C++ without studying a good C++ book...

read books on that list @AhmedJolani
 
(removed)
 
you seem like you are willing to learn
 
@stdOrgnlDave ok..
 
@MooingDuck operator> is overloaded
@MooingDuck and it is trying to deduce the type of operator< with auto
 
Xeo
12:23 AM
May 7 at 14:19, by Xeo
struct X{};

bool f(X& a, int const& b){ return true; }

template<class T, class U>
auto g(T const& v, U const& u) -> decltype(v > u){ return v > u; }

int main(void) {
  X x;
  g(x, 6);
}
@MooingDuck You were on the right track
 
I got it now!
 
Xeo
operator> was not correctly overloaded for const, which causes the decltype to fail and the operator< to SFINAE out
 
function template
 
brb 1 min
 
@stdOrgnlDave ah right, I remember the thought process now. When finding overloads for operator<, it tries the template, but the template uses operator> where the LHS is const, which has no match (A::operator> is non const), so SFINAE fails, and there's no other function that it could be so it returns an error.
@stdOrgnlDave and even if it compiled that would be an infinite loop
 
Xeo
12:25 AM
@MooingDuck It compiles on MSVC, and goes into an infinite recursion xD
 
@Xeo GAH! I HAZ LAG
@Xeo compile time or run time?
 
@MooingDuck yes, indeed. making a::operator> const makes it compile
 
Xeo
runtime
It even warns about the infinite recursion
But I really don't feel like dealing with the bug (aka submitting it to MS Connect)
@stdOrgnlDave, what's your version of the VS11 beta?
 
fyi: I'm dealing with ~12 second delay on chat.
 
Xeo
Try (forced) reloading
 
12:29 AM
This is a normal thing here at my job and SO chat. They don't play nice
@Xeo ctrl+f5?
 
Xeo
Aye
 
@Xeo don't run it, waiting for RC1
 
Xeo
Ah, k
Anybody here with VS11 beta?
 
@Xeo remember that multi-pointer template?
 
Xeo
Aye...?
 
12:31 AM
@xeo @Mysticial ran it on a 3.2ghz core 2 on the latest ICC for about what was it, almost 6 hours before it dumped core? talk about slow at templates
 
what's the order of operations on "(unsigned)A > B"?
 
Is it hard for you guys to work for Google?
 
Xeo
I don't work for Google
 
@AhmedJolani where are you from?
 
Xeo
@MooingDuck cast, then comp.
 
12:33 AM
I know
 
@AhmedJolani we don't work for google, but it's easy for me to use google
 
Jordan
 
Who works for Google?
 
no body
I mean if you intended to?
 
Xeo
Nobody here with VS11 beta? :(
 
How would we know if it's hard? :P
 
@Xeo I think that MSVC compiles that in the decltype because it doesnt use const's in the decltype. it just takes the two non-const things passed it and checks them, it doesn't care that the function takes const, the objects themselves are not const
 
have you tried?
 
@stdOrgnlDave Jordan
 
Xeo
@stdOrgnlDave That's what I said, it ignores the const qualifier in the trailing return type (not in normal decltype)
 
@Xeo but here's the thing. a and b are not const. so why is it incorrect behavior to do that?
 
Xeo
Huh?
 
@stdOrgnlDave they are in the template function
 
^ someone changed "haz" to "has"
 
Xeo
a and b are ref-to-const parameters, so... yes, it's definitly incorrect behaviour
 
12:36 AM
no they're not. they are in the function, but a and b themselves are not, they are just two objects, one a struct A and one an int
 
Amman, Jordan
Princess Sumaya University for Technology
1991-01-14
Works at Zain
You sir, are _very_ easy to google O.o
 
Xeo
@stdOrgnlDave That doesn't matter, there's no perfect forwarding in play here
 
Princess school?
 
Xeo
Only the parameters matter
 
@stdOrgnlDave they're const to the function
 
Xeo
12:37 AM
It might matter if you make that template constexpr and talk about argument substitution, but...
 
@Pubby talking to me?
 
I can see why MSVC might think it acceptable behavior in the trailing decltype...or maybe it is just a bug
 
@stdOrgnlDave it's a bug
 
then someone should tell MS
 
@AhmedJolani Princess Sumaya is/was a person?
 
12:38 AM
@stdOrgnlDave technically it's the same as calling the wrong function. (because that's exactly what's going on)
 
She is a princess
now
@Pubby are you really 92 years old?
 
@AhmedJolani no
@stdOrgnlDave I'm on it now
 
Feb 22 at 21:02, by Pubby
No, I'm 5000
 
Xeo
lawl
Intellisense gets it right and cl gets it wrong
 
hahaa ok
 
Xeo
12:40 AM
struct X{};

bool operator>(X& a, int const& b){ return true; }

template<class T, class U>
auto operator<(T const& v, U const& u) -> decltype(v > u){ return true; }

int main(void) {
  X x;
  x < 6;
}
Everyone agrees that this should not compile?
 
@Xeo I do
 
I think so.
I mean, I think it shouldn't
 
Xeo
As you probably guessed, it does (in MSVC11 beta)
 
yes, I guessed
 
12:42 AM
I won..
 
Xeo
Now, lets take out the operator overloading and substitute it with real functions
struct X{};

bool f(X& a, int const& b){ return true; }

template<class T, class U>
auto g(T const& v, U const& u) -> decltype(f(v,u)){ return true; }

int main(void) {
  X x;
  g(x, 6);
}
And guess what
 
@AhmedJolani "should compile" and "does compile" are two different things
 
aha ok my bad
 
@xeo it shouldn't compile still
 
Xeo
12:44 AM
Exact same code (as far as I can see), but now MSVC refuses to compile
 
@Xeo huh
 
Xeo
So it is something with decltype and operator overloading
And that clearly shows it's a bug, imho anyways
 
@Xeo I wonder...
 
struct X{};

X f(X& a, int const& b){ return X(); } //this shows why this is a bug

template<class T, class U>
auto g(T const& v, U const& u) -> decltype(f(v,u)){ return true; }

int main(void) {
  X x;
  g(x, 6);
}
 
Xeo
@stdOrgnlDave Inconsistency in overload resolution is a bug, no matter if it's a bug to the standard or a bug to the implementation, it's a bug in any case.
@MooingDuck You need to adjust g
 
@Xeo it refuses to compile this ideone.com/rZu1f
 
Xeo
@MooingDuck free function works too
 
wait a second,
 
Xeo
@stdOrgnlDave Yeah, inconsistency in overload resolution
 
12:48 AM
why doesn't operator>(a,b) work?
 
Xeo
Wait
 
am I being stupid!?
 
Xeo
operator>(x,6) works for me
but operator<(x,6) doesn't
but x < 6 does
MAJOR WTF
 
guys I just wanna thank for giving me that chance to learn something new here, I hope we become friends.
 
Xeo
No nevermind
operator<(x,6) doesn't work either
I just thought the warning was an error
 
12:50 AM
@Xeo it won't compile this ideone.com/zk5Sm
1>c:\dev\btest3\btest3\main.cpp(105): error C2893: Failed to specialize function template ''unknown-type' operator <(const A &,const B &)'
1>          With the following template arguments:
1>          'A'
1>          'int'
1>c:\dev\btest3\btest3\main.cpp(105): error C2676: binary '<' : 'A' does not define this operator or a conversion to a type acceptable to the predefined operator
 
Xeo
Yep, explicitly calling the operator in function form (operator<(a,b)) in the trailing return type makes it fail to compile
 
isn't that odd
even if bool operator>(A& a, const int& inty) { return a.a > inty; } isn't a member function
 
Xeo
I can only think that the free function calling form uses the same lookup routine as if calling normal free functions
Which is the correct one
 
VC is so weird :-(
 
Xeo
12:52 AM
but calling it in operator overload form makes VC dizzy or something
@Mooing, edit your Connect report so it says "when replaced with a free function"
 
@MooingDuck here is exact difference ideone.com/9OtdZ
it is as simple as that
I reduced it to > or operator>. it compiles on > but not operator>
how f*cked up is that shit eh?
I love how my program can hit a stack overflow during recursion and I can click continue.
and then it keeps doing stuff
 
Xeo
At first I thought it only dropped const on the first argument, which might be explained with weird "implied object argument" and stuff, but it actually drops const on all arguments:
 
guys I started with this http://c.learncodethehardway.org/ and this The
C+ +
Programming
Language ?
 
Xeo
struct X{};

bool operator>(X& a, int& b){ return true; }

template<class T, class U>
auto operator<(T const& v, U const& u) -> decltype(v > u){ return true; }

int main(void) {
  X x;
  x < 6;
}
 

« first day (584 days earlier)      last day (4356 days later) »