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

2:01 PM
What exception guarantee are provided by std::unordered_map::insert and std::unordered_map::erase?
 
You won't get your money back.
 
> If the formulation of a complexity requirement calls for a negative number of operations, the actual requirement is zero operations.
WTF?
 
Where did you find that?
 
Just be glad they didn't call for unsigned modulo arithmetic.
 
The standard.
§17.5.1.4p6
 
2:07 PM
this correct?
 
I think you're missing something.
ADL does not apply to no-args functions by definition. It's Argument -Dependent Lookup.
Also, the names must match :)
 
in all three cases you mean?
 
The two free functions. If the names are different, there's only one candidate, which is obviously the one with the correct name.
 
so like this
 
Yes, that's getting better. But you cannot get ADL to work with int.
 
2:13 PM
oh, so the args have to be my own types?
 
Either that, or templates with your types as arguments.
 
Yes! Because the types of those args will decide which namespace to lookup in.
 
hmmm, this must be getting very close
 
Also, you're calling a.foo by qualified lookup. Calling foo without qualification inside A scope would reveal that ADL is not used when a member is found.
 
@TonyTheLion Now you need to put a type inside that namespace, so that ADL goes look up in there.
 
2:19 PM
@RMartinhoFernandes the bar namespace?
 
@TonyTheLion ADL means that the compiler will also look in the namespace that the arguments belong to. Here is a very simple example: ideone.com/MLRMu
 
so like my B type, I can just move it in the namespace?
or a new type?
 
i am trying to create generic element filler for associative container : codepaste.net/e5xskp
 
Well, a type that you use as argument to the function.
See @StackedCrooked's example with the swap function.
 
2:20 PM
but unable to figure out how value_type works
can anyone help with me code?
 
@MrAnubis What's dType? Also, you will probably not be able to get your code to compile like that. You probably need SFINAE.
 
This is a job for specialization.
 
so here my function inside the bar namespace will be looked up using ADL or will the freestanding use ADL?
 
@Tony: a bit more obvious: ideone.com/TOABb
 
typeid is not for selecting a code path for a particular type.
 
2:23 PM
@RMartinhoFernandes : dType was from old code , forgot to delete it
@Potatoswatter why so ?
 
I assumed dType was supposed to be elem, is that right?
 
nah , yes
 
@MrAnubis Because the point of templates is to compile the Right Thing, and only the right thing. Your strategy tries to compile all the code paths, including the ones that won't even compile.
 
are you taking about push_back? , i can use inserters
anyways , what do it to make my generic filler?
 
elem var = 'a'; only compiles if the type is char (modulo conversions).
 
2:26 PM
I'm talking about if(typeid(elem) == typeid(char) ). Generally speaking, that won't fly.
 
That path still needs to compile, even if the type is not char.
 
@RMartinhoFernandes It would be nice to create a C++ multiple-choice test where you need to guess the output of code samples like these.
 
Yeah… due to integral conversions, this will probably work for int and char. (Not bothering to check.) But that's not the point.
 
@RMartinhoFernandes why so?
 
@MrAnubis Because you can't compile only part of a function.
 
2:28 PM
@Potatoswatter typeid works for every type
 
@MrAnubis Because this isn't how templates work. Dead code gets compiled the way it does in any other function.
 
good morning, potato i can't believe you're still on here
 
@RMartinhoFernandes that is something new i cam accross
 
@MrAnubis But var = 'a'; doesn't work for every type.
 
@MrAnubis That particular line will compile, yes. But the construct it introduces will not.
 
2:29 PM
yes thats right
 
if (true)
{
    std::cout << "hello world\n";
}
else
{
    omg lulz this doesn't compile :(
}
 
question!
can ADL apply for functions with int parameters?
 
@StephenGranet Yeah, insomnia.
 
ah, :(
 
@JohannesSchaublitb int doesn't live in a namespace, does it?
 
2:30 PM
@JohannesSchaublitb Only int parameters?
Just trying to weed out any tricks.
 
@RMartinhoFernandes yep only int parameters
like so void f(int value) { }
 
What namespaces should be searched here? :/
 
Well, whether it applies or not, I have no idea. It doesn't make a difference, because it won't find any extra candidates, will it?
 
@JohannesSchaublitb Is there some trick with explicit template arguments?
 
2:31 PM
answer?
 
namespace A { struct B { operator int(); }; void f(int); } int main() { f(A::B()); }
 
damn corner cases, C++ is full of them
 
So any article you guyz can link me to create generic filler?
 
Sometimes it seems C++ is built from corner cases only :)
@MrAnubis What is a generic filler? A lame song on an album?
 
@FredOverflow C++ is a polygonal language!
 
2:33 PM
Conversion functions are the devil.
 
At least if they're implicit. You can make them explicit in C++0x.
 
@RMartinhoFernandes It's obtuse in any case.
 
@FredOverflow nah , it what i call when i want to fill some container with some data to practice
 
@FredOverflow Thank the Holy SC for that.
 
#include <algorithm>
std::fill(answers.begin(), answers.end(), 42);
 
2:34 PM
@FredOverflow but right now i want to create generic filler :), your code will work for empty container?
then i will move to my main problem
 
template<typename Iterator, typename T>
void fill(Iterator begin, Iterator end, const T& x)
{
    for (; begin != end; ++begin)
    {
        *begin = x;
    }
}
@MrAnubis No, because there's nothing to fill in an empty container.
But we have back_inserter for that.
 
@FredOverflow why would you say that function whole must compile , whats the reason behind?
 
@MrAnubis Because that's how C++ works?
As soon as the compiler detects nonsense inside a function body, it reports a compiler error. What else should it do?
 
9 mins ago, by FredOverflow
if (true)
{
    std::cout << "hello world\n";
}
else
{
    omg lulz this doesn't compile :(
}
 
std::fill_n(std::back_inserter(answers), 100, 42);   // works for empty container
@RMartinhoFernandes The else part is clearly nonsense, so the compiler reports an error.
 
2:38 PM
Exactly.
Why should it accept nonsense?
 
i heard about this case switch that you can't initialize variable inside a case , does this has to do with what you guyz are saying?
 
Not even the people in Lounge<C++> accept nonsense, and C++ compilers are way more pedantic than them.
(than them? sounds funny)
@MrAnubis No, not at all. Just put the stuff after the case label in its own block and you should be fine.
 
else
{
    omg lulz this doesn't compile :(
}
 
switch (answer)
{
    case 42:
    {
        int local = 123;
        foo(bar, bar);
        // ...
    }
    case 0:
    {
        int another_local = 12345;
        // ...
    }
}
 
@MrAnubis I don't know if you can understand this: ideone.com/rT2zn. I hacked it up in a few minutes. And it's not working. :(
 
2:41 PM
@MrAnubis omg lulz this doesn't compile :( is not valid C++. Are you questioning that?
 
omg lulz this doesn't compile :( -> what is it that doesn't compiles?
 
That sentence.
 
computers follow instructions, "omg lulz this doesn't compile" isn't an instruction, it doesn't know what to do with that
 
prog.cpp:11:28: warning: missing terminating ' character
prog.cpp:11: error: missing terminating ' character
prog.cpp: In function ‘int main()’:
prog.cpp:11: error: ‘omg’ was not declared in this scope
prog.cpp:11: error: expected `;' before ‘lulz’
 
@RMartinhoFernandes omg , this code is far beyond my understanding
 
2:44 PM
And it's not working.
 
@FredOverflow got it , you mean to say , that i can't skip else statement , c++ will always compile all statements
@RMartinhoFernandes right
 
if ( cup.empty() ) std::fill( cup.begin(), cup.end() ); // C++ is not the path to enlightenment
 
@MrAnubis Much better: ideone.com/Q0VJA
 
^ if your cup is empty, C++ will not fill it.
 
WTF, I used postfix increment. What the hell is wrong with me?
 
2:49 PM
i can't skip else statement , c++ will still always compile all statements , right?
 
Wow , Great thanks to you all)
 
I just wrote this: touch(it);.
 
2:54 PM
@RMartinhoFernandes : check out this code : codepaste.net/i3pnej , should have printed out some other number 150+.. if it compiles all the statements
 
Now try it with std::vector<std::string>.
It worked because char can be converted to int.
 
error: invalid conversion from 'int' to 'const char*' [-fpermissive]|
right
 
See?
Trust us, typeid is not what you want here.
 
yes , thanks
 
sounds like a SFINAE case
 
2:57 PM
To the room: how many times have you used typeid?
 
never
 
Often for debugging.
Otherwise, no.
 
typeid is one of the things in the language that has a lot more abuses than uses.
I only used it once, when I had boost::any in my bencoding code. I switched to boost::variant and now it's gone :)
 
@RMartinhoFernandes hmmm then any good alternative techniques of typeid ?
 
@MrAnubis It's not a matter of finding alternatives. It's more like just forgetting it ever existed.
There are various mutually unrelated problems out there with a wide range of solutions.
 
3:01 PM
@MrAnubis What you want is to decide on the type at compile-time.
 
K K
 
Or could do something like std::iota does.
 
Specialization, SFINAE, boost::variant, visitor pattern, blah. All totally different things.
 
The std::iota approach sounds much better.
 
What, just call std::iota and forget this exercise :v) ?
 
3:03 PM
Or implement something like std::iota, if the point is to exercise.
 
ok :)
 
Make a template and put a single path in your code.
It will automagically work for all types that support the required operations.
 
Thanks again , i appreciate the help)
 
haven't seen @Cat much
has he been here this weekend?
 
Didn't see him.
Probably moving or looking for a place to move to.
 
3:07 PM
oh yea
forgot about that
so how is your job hunt going?
 
Still waiting for calls.
 
from the companies you sent your CV to?
 
and how many did you do?
if I may be so curious
 
3:08 PM
Four.
 
Should i use polymorphism to store heterogeneous objects in a container? I.e. i have 3 derived classes that i need to store, should i make three separate containers?
 
If you're only using functionality of the base class, I don't see a problem with a single container.
Btw, boost::ptr_vector.
 
@RMartinhoFernandes : was curious to show show the essay i got from compiler when i had used std::string i56.tinypic.com/1r9g5x.png
 
:)
You need to get used to it.
 
3:14 PM
I was going to use functionality in all of them. This is what I was thinking: the base class is called Insurance, and three subclasses (car, house, life). In the base class Insurance I was going to write a method that prints out the private member variables (formatted of course). I was then going to overload that function in every derived class to 1) First call the parents PrintData() function, and then print its own data
 
override, not overload.
 
so when I store all of these objects, is it a bad idea to store them all in the same container, and then when i want to print each record out, call the printData() function on each element, no matter which derived class it is
right, ty
 
That's using only functionality of the base class, as in, only the interface of the base class.
 
ohh
okay
i see, ty
that clears it all up
 
I like TortoiseHg, but this is like, one of the most epic interface fails in history.
 
3:22 PM
user image
3
another way to make a graph
 
Hey!
Been offline?
 
Isn't that bad for your health?
 
Not as bad as vodka.
 
3:28 PM
Well, I have good news. No one bashed singletons or PHP in your absence. You didn't miss a thing!
 
Als
ohla
okay pin drop silence
 
as;ldja;lsdka;sldfj
 
Hey, stop cleaning your keyboard on the chat.
 
sorry, homerow mayhem
:p
 
@TonyTheLion that's very impressive. where did you find that? or did you do that yourself?
 
3:40 PM
My bet is reddit.
 
@RMartinhoFernandes could be cat...
 
Als
@RMartinhoFernandes: here yesterdays conversation
4
A: sizeof() applied to structure and variable

AlsBoth will and should indeed return the same value. From MSDN: The sizeof Operator The sizeof operator gives the amount of storage, in bytes, required to store an object of the type of the operand. This operator allows you to avoid specifying machine-dependent data sizes in your programs. siz...

Am i banned or something? None seems to notice me
 
@Als possibly someone downvoted for the use of MSDN as reference. and no you're not banned. :-)
 
Als
oh thanks, indeed i can be seen atleast
 
Yes, he is banned. You're both banned, that's why you can see each other.
I have no idea who I'm talking to, just saying this in case someone that is banned asked if he's banned.
 
Als
3:46 PM
MSDN as reference, what else then should be used as an reference
 
The C++ standard, or N3290
 
Als
@AlfPSteinbach: Thats c
standard has interface information?
 
N3290 §5.3.3/1: "The sizeof op e rator yields the numb e r of bytes in the ob je ct re pres entation of its op erand. The op e rand is either an expre ssion, which is an une valuate d op erand (Clause 5 ), or a parenthe size d type-id ."
 
Als
@RMartinhoFernandes: You are confusing me
 
there's some work in removing the spaces. i don't know where they come from.
 
3:48 PM
@AlfPSteinbach Bad PDF reader.
 
foxit?
i wouldn't use adobe
 
For example.
 
Als
I use fox it, but it works well
it doesn't give me those spaces
 
@Als Don't worry you're not banned, I was pulling your leg :)
 
and i wouldn't use the one that came bundled with windows
 
3:49 PM
> The sizeof operator yields the number of bytes in the object representation of its operand. The operand is either an expression, which is an unevaluated operand (Clause 5), or a parenthesized type-id.
 
Als
@RMartinhoFernandes: Like i wont know if i was :P
 
There, copy-pasted straight from my PDF reader.
 
Which is?
 
Als
what is which is?
 
Als
3:50 PM
Foxit works like a charm I don't know why it gives you those odd spaces
 
SumatraPDF is a no-nonsense reader, so it may not fit some people's use cases, particularly those that use nonsense features.
:)
 
Als
oh btw, I am looking forward to cast one downvote today, so if anyone needs one or sees a bright opportunity, where it could be useful, please let me know
 
Trying to get to a multiple of 10?
 
442132: Ah, not bad. Drag and drop doesn't work, but that's just little detail.
 
Als
@RMartinhoFernandes: :P Yurp, As i said yesterday, I am going to stop posting answers, and im at 22,321 which looks very odd so trying to make it 22,320 and then shut the fcuk up.
so u see
 
3:53 PM
hm, 2-0
 
@Als Oh, come on, forget that "stop posting answers" nonsense!
That way you are letting "them" (whoever is downvoting you regularly) win.
@AlfPSteinbach Drag and drop and in dropping a PDF from Explorer?
Hmm, never tried that.
 
@RMartinhoFernandes yes
 
Als
@RMartinhoFernandes: naah its okay, I mean i don't want to make an issue of it actually, just want to lay low.
but i decided anyways
 
@AlfPSteinbach Wait, it works.
 
@RMartinhoFernandes not here. it gets as far as displaying a "+" icon for drop-is-OK-now, that's all
 
3:57 PM
Hmm, could be a bug introduced in 1.7. I'm still running 1.6.
 
I sort of miss Borland with ads about "no nonsense" and "no speed limit".
 
Yep, that's right, just installed 1.7 and it doesn't work anymore.
Needs a bug report.
 
I have an unerring instinct for always trying the Thing That Does Not Work first, he he.
 
Als
@AlfPSteinbach: Those things expect u to fix them :P
 
4:04 PM
Hey, free strtok bashing!
 
Als
hehe
not null terminated string
i don't know why they would not just print it out and see
there can be only parameter that could be wrong there
 
There, reported. It feels good to be a good citizen :)
@Als I'm trying to understand what could possibly be wrong, but my mind freezes right after strtok.
 
Als
@RMartinhoFernandes: Some print statements or debug breakpoints shall reveal it really
 
I completely forgot how strtok works, other than "It calls forth Shub-Niggurath, The Black Goat of the Woods with a Thousand Young, Wife of the Not-to-Be-Named One, and devours your children."
 
4:10 PM
lol
 
Als
@TonyTheLion: Are you just here for background laughter today?
 
lol
I'm bored actually, so I thought I'd troll this room
with lol
 
Als
you met humans yesterday if i remember you saying that
how did it go
 
yea it was nice to be in meatspace for a while
but now I'm back to cyber space
haha
 
Als
are you high today?
 
4:13 PM
What?
 
Als
You seem to laugh a bit more easily
 
Als
I see a lol lulz or haha in everything you say
 
I don't take drugs, and neither will I ever take drugs, so no I'm not high
 
Als
so just thought you are high or something
uhm
 
cpx
4:14 PM
lol
 
Als
meds are drugs too
 
no, I'm pretty much like any other day
yea, but I'm not taking any meds either
I was talking about hard drugs, like cocaine or some shit like that
 
Als
are you taking any chicks then?
 
I wish
 
Als
those might have this effect.
 
4:15 PM
just an experiment (@als u can now see what text in standard is like compared to MSDN)
 
5.3.3
Sizeof
[expr.sizeof]
1
The sizeof operator yields the number of bytes in the object representation of its operand. The operand is
either an expression, which is an unevaluated operand (Clause 5), or a parenthesized type-id. The sizeof
operator shall not be applied to an expression that has function or incomplete type, to an enumeration
type whose underlying type is not fixed before all its enumerators have been declared, to the parenthesized
name of such types, or to an lvalue that designates a bit-field. sizeof(char), sizeof(signed char) and
 
hehehe
 
that reader is much better on clipboard ops!
 
4:15 PM
Of course it is.
It's optimized for stuff, not for nonsense. :P
 
Hahahaha not such an uncommon name I hope @RMartinhoFernandes
 
@KianMayne What are you talking about?
 
The link I posted
 
check the link he posted
 
Als
@AlfPSteinbach: yeah but why quote the standard for every small thing, its an overkill
 
4:16 PM
Oh, I knew that.
Some time ago I googled my name and found that.
Back then, it was the first hit.
 
Now my StackOverflow profile is first.
I beat the terrorists!
 
Als
woot terrorists
 
Als
okay folks
calling it a day
have a good one all of ya
 
4:19 PM
Is it late over there?
 
Als
Not really...9.50pm
i will go have dinner and watch a movie
and then sleep a bit early
 
Als
Thanks
You all have fun and dont break anything :)
good day
 
What does the default std::hash<T> template do?
 
@RMartinhoFernandes I doubt the primary template is defined.
 
4:36 PM
Yeah, you're right.
 
Controls the cipher mode for Rijndael and Twofish encryption. Possible values are "CBC" (the default) and "ECB".

CBC is an acronym for Cipher Block Chaining, ECB is an acronym for Electronic CookBook.
:L Electronic CookBook
 
4:52 PM
> provide two nested types result_type and argument_type which shall be synonyms for size_t and Key, respectively,
Any way of fulfilling this Hash requirement without typedefing the things by hand?
Some base class somewhere?
 

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