« first day (479 days earlier)      last day (4467 days later) » 

12:15 AM
 
12:29 AM
why is MSVC10 compiling my header files that aren't included anywhere? Does it normally do that?
 
Then it has to be included somewhere.
 
I had one file: "main.cpp". I added a new .cpp file, renamed it "backup.h", and copied "main.cpp" into it. MSVC10 is now compiling both "main.cpp" and "backup.h". Apparently it recalls the old type.
yeah, added a new header file, doesn't have that problem. Apperently it's only if you change from .cpp to .h
 
Xeo
@MooingDuck right-click the ".h" file, click Properties, change the file type to Header
 
@Xeo I only needed them for a short test, I deleted both. Good to know for the future thoguh
 
Xeo
The file type doesn't automatically change when renaming the extension
 
12:43 AM
0
Q: Returning a string stream (char*)

user1169865My professor wants me to output the "area" from calculateArea as a char/string. I'm not sure exactly what he means, but maybe some of you might understand. #include <iostream> #include "math.h" #include <cmath> #include <sstream> #include <string> using namespace std; ...

That's the first time I've seen a function return a const char& that's not part of std::string
 
Yeah, I tried answering that one.
But it's so vague, I don't know what to do with it.
 
ErikMcClure? I know him! Well, kinda
 
@Pubby Say "hi" to him for me, then. :P
 
1:46 AM
Quick: I need a buzzword phrase!
 
Just finished the last part of GoingNative an I feel sad again :(
 
Watch it again?
 
Na, gotta sleep.
return EXIT_SUCCESS;
 
2:03 AM
@DeadMG hi.
 
Xeo
room topic changed to Lounge<C++>: Sorry, I couldn't resist. [c++] [c++11] [c++-faq]
 
Dammit @Xeo.
 
2:25 AM
I'm kinda proud of my comment at stackoverflow.com/a/9169785/103167
 
Was it over the top?
 
I don't think so.
Anyone has an explanation of why this particular instance of UB manifested itself as a std::bad_alloc?
0
Q: std::sort getting a std::bad_alloc

user988098class RankList { public: struct RankListComparator { bool operator()(const std::pair<boost::numeric::ublas::vector<double>, double>& a, const std::pair<boost::numeric::ublas::vector<double>, double>& b) { return a.second >= b.second; } }; vo...

 
I wonder if there was runaway allocation.
 
@RMartinhoFernandes I'm not curious enough to check but I know that the UB from (ab)using the std::sort & friends implementations of libstdc++ is pretty wild.
 
2:31 AM
Oh hey, I bet it tried to allocate -1 elements, appropriately cast
 
I mean, we all know that anything can happen, yeah, but we also know that compilers don't use RNGs. Why was std::sort allocating anything?
 
std::make_heap or moral equivalent?
(Or whatever the actual allocation helper that that heap functions use.)
 
Oh, wait, I keep forgetting old swaps could involve copies.
 
Could be.
 
@LucDanton I believe that works in-place.
 
2:34 AM
Copies are unlikely to cause this problem.
 
What else could involve dynamic allocation?
Heapsort is an in-place algorithm.
 
BTW your explanation of transitivity is lacking
 
Ow, copy&paste fail.
 
I'm confused. Did I imagine that one or some of the Standard algorithms allocates memory using a special routine?
There is get_temporary_buffer but no other mention that its specification apparently.
Not in algorithms but in general utilities, as expected.
 
get_temporary_buffer is not supposed to fail.
It doesn't guarantee the returned buffer is as big as you wanted.
Oh, wait, it requires a non-negative length. That could throw.
 
2:57 AM
Do DLLs specify calling conventions?
 
The functions inside require particular calling conventions, but the DLL usually doesn't share that information.
It's possible to embed a type library, or .NET metadata, etc.
Usually, however, the caller learns the correct convention from the header file bundled with the DLL (and import library).
The calling convention does also affect name mangling, for DLLs which use it. Many don't.
 
Alright, thanks for the explanation.
 
3:13 AM
Oh damn, it's the Funday Monday!
 
@EtiennedeMartel day9's?
 
I usually get them off youtube afterward... what's the live link?
 
thx
nuclear bunker fail
 
Xeo
3:45 AM
Quick question, are the binary type traits (true/false) required to inherit from std::integral_constant<bool, ???>?
 
Yes.
Btw, those are called unary type traits or binary type traits depending on the number of arguments.
is_const is a unary type trait, is_convertible is binary.
 
Xeo
Yeah, I just couldn't remember what the is_blub traits where called
And binary because the result is one of two things. :P
I hate it, when my nickname isn't available. -.-
I should seriously consider looking for a new one...
 
4:03 AM
> Mate, nobody wants to hear about your sexual experience with various anthropomorphised tool chains. Just ask the damn question. – paxdiablo 2 mins ago
3
 
Xeo
@RMartinhoFernandes Aww, I like the way the question was formulated!
 
@Xeo That's probably because of your affair with clang :P
 
4:23 AM
@RMartinhoFernandes agreed.
 
Xeo
4:42 AM
4
A: defining typed constant numbers in C/C++

R..They're not equivalent. 1U is valid in #if preprocessing directives. (unsigned int)1 is a syntax error at the preprocessor level. You could however make it (unsigned)+1 and it would be valid in the preprocessor, but only because of an obscure rule few people know..

Crazy preprocessor!
 
user406009
Well the preprocessor is mostly stupid anyways.
 
Xeo
> "Standard Library" is a proper noun and should be capitalized. Don't fuck with my posts if you don't know what you're doing. [from here]
Gee, just because of a little miskate -.-
 
Xeo
Of course, I had to misspell "mistake" right there and only notice it after 2 minutes...
 
Oh, I didn't mention it because I thought it was on purpose.
Trying to make an autological word.
 
5:06 AM
Wonder why e-books are sometimes distributed as .chm
 
> Hippopotomonstrosesquipedaliophobia – fear of long words
 
People with that should stay away from .NET
 
If only they'd have picked a webscale solution.
 
Xeo
5:18 AM
> 18x16GB
Jelly.
Damn, this connection speed is becoming unbearable. -.- Brb, restarting router.
Let's see if this was of any help. :s
 
Xeo
5:41 AM
FFS, restarting didn't help...
 
Right now I'm placing all my UDLs on namespace wheels::literals, regardless of what they are. I do keep them in separate headers depending on their usage, like <wheels/time.hpp> (for seconds, milliseconds, etc) and <wheels/byte_multiples.hpp> (for kilobytes, mebibytes, etc). Then I just #include the appropriate header and using namespace wheels::literals; and use them (that namespace has nothing but UDL definitions).
Does this sound nasty? Do you think I should have a different namespace for each kind of literals, instead?
 
I have detail, adl and operators namespaces (re)opened everywhere.
 
Xeo
Fuck, I can't be productive with the connection crippling like this... I'm going to sleep, g'night!
 
It is problematic for detail and adl as it's not unheard of to reopen one of those to define a throwaway helper thingy that exists elsewhere...
It's not problematic for operators as no two operators are going to share the same name by design. I think this matches your situations the most.
e.g. annex/operators.hpp has plus, times, divides etc. while annex/operators/make_unique.hpp has make_unique all in annex::operators. (Not to be confused with annex/unique.hpp where there's a make_unique in the annex namespace.)
 
That's why I placed everything in it: if I happen to create two UDLs with the same name, I want the compiler to throw up immediately. Since they can't be used with scoping, UDLs should be completely unambiguous (hence no _m for minutes).
 
5:53 AM
Will work fine for templates and classes, not so fine for functions. Strictly based on experience.
 
What do you mean? You can't have template UDLs.
Sadly.
 
Xeo
@RMartinhoFernandes Sure, raw form for numbers
 
Do you mean string UDL?
 
Xeo
Just not for string literals
 
@Xeo Not what I meant. _base<N> comes to mind.
 
Xeo
5:54 AM
Ah
 
Have you heard of template argument deduction? The latest in C++03 technology.
 
Since when do templates have to be called with <> somewhere?
 
How do you deduce a template argument from an unsigned long long?
 
In any case my comment was regarding ODR violations. IME template and class redefinitions are correctly diagnosed, not so much with functions. YMMV depending on compiler.
 
Xeo
5:57 AM
@LucDanton Good luck getting 1234_base<2> to work with TAD
 
Do you guys not know what a counter-argument is?
 
@LucDanton Ah, I get it.
At least I'll have diagnostics if I #include conflicting headers.
 
Prima: all A are cats
Secunda: a is a A and clearly not a cat
Prima: good luck getting a to meow
I know a won't meow, and I know some templates can't be called without passing template arguments. Both are besides the point.
i.e. as soon as I exhibited a template that does not, in fact, need <> to be called the point was made.
 
I could have a udl_smoke_test.cpp that does nothing but #include everything that has UDLs in it.
 
I'm making it extra clear because you guys are having an attack of the stupids tonight.
 
Xeo
5:59 AM
Is it bad that I don't follow?
 
@RMartinhoFernandes Hey, I could have a unit test to check those potential conflict from detail exactly like that. Neat trick.
 
Xeo
Anyways, off to sleep!
 
6 mins ago, by R. Martinho Fernandes
@Xeo Not what I meant. _base<N> comes to mind.
is what I retorted to.
 
@Xeo We both know you'll still be here in an hour.
 
6:01 AM
Calling operator"" _base<N>(foo) would also be super duper trivial to do, if it were allowed to write such a template.
 
_base<N> is really not the bestest of examples. The only non-decimal bases you'll ever care about are already covered with 0x.
Maybe 0, if you use POSIX open and such. On POSIX they have macro constants for that.
I really don't want to see 1020102_ternary in code anywhere.
But I do know I wanted to do _something<T> once. I just can't remember what it was.
 
Xeo
@RMarthinho: Most likely, but atleast from my iPod Touch and from within my bed!
 
6:19 AM
:)
 
Xeo
Robot, a question on Haskell list comprehensions. When you write [a * b | a <- range1, b <- range2], does that multiply every value in range1 with every value in range2? Or does it just multiply every pair?
 
Cartesian product.
Multiplication of every pair in lockstep would be: ideone.com/4KlwN
Pattern matching is awesome.
 
Xeo
Then the size of the output range will always be the product of the size of ranges in the list comp?
 
If the ranges are finite!
 
And you don't apply filters.
 
Xeo
6:25 AM
Obviously I meant the size after filtering. :P
 
@Xeo But you can filter after the cartesian product.
 
Xeo
Ugh, I can't really open those Ideone links here, they're killing my poor iPod Touch 2G (yes, it's ancient)...
 
Oh no, snow.
Noooooooooooooooooooo.
 
What, you're a chionophobe?
 
I hate winter.
And cold and snow.
And ice.
 
6:33 AM
I'm impressed that you are actually still alive.
It's like -20 where you live.
 
Yes, I should get a medal and lots of money.
 
Have a pity star instead.
 
Instead, I have to go outside and suffer torment.
You know what, if they wanted to make hell really bad, they'd make it extremely cold instead of extremely hot.
 
Cold is worse than heat.
 
You know how it is with marketing departments taking over control of production.
 
user406009
6:36 AM
cold > heat. It is much easier to warm up than cool down.
 
You don't often hear of people dying of heat.
 
Yes, you do.
 
But what do you prefer, hypothermia or melting?
 
I don't really have a preference there.
Can't really say which one is my favorite.
 
6:39 AM
Well, I'll take the one which makes you lose conciousness faster.
And doesn't have to do with cold.
Obviously.
 
Falling into lava is probably a quick death.
 
If you fall face first, I guess.
 
Faster? Wouldn't you rather die slower?
 
Why would you want to die slower?
 
Because you're alive longer.
 
6:40 AM
@CatPlusPlus Assuming the lava is deeper than 5 cm.
 
But that doesn't make much sense.
 
Yeah. I mean right now you're dying pretty slow. 70 year slow.
 
At least I can use the Internet.
 
@Pubby We are talking about painful ways to die. So faster is better.
 
Surfing while dying of cold? Not so much.
 
6:42 AM
It's -10 here. That must seem tropical for you.
 
 
@StackedCrooked Especially considering the velocity you'd need to get into lava.
Unless you're denser than rocks naturally I guess.
 
ʻAʻā lava is pretty fluid. Not sure how fluid exactly.
 
@Pubby there is a surfing resort in hell? awesome! at least I can feel forward to surfing now.
 
@LucDanton According to Indiana Jones movies it's easy to fall into it.
 
6:45 AM
No wait, that's the non-fluid one.
There's a fluid one.
 
@RMartinhoFernandes Isn't that related to viscosity or another material property (that is not density) anyway? Not that it helps when falling into it when it's not viscous enough of course.
 
If you believe DF, you drown in lava faster than you burn.
 
> on top of it.
Called it!
 
> You do not sink in a Lava pool. You combust on top of it.
Ok.
 
6:47 AM
Rocks. Doesn't matter how molten.
 
Stupid physics. If I want to take a swim in the nearest lava pool, I shall do so.
 
@RMartinhoFernandes Prove them wrong!
 
I need to gather money to travel to the nearest lava pool though.
 
Take some with you in a bucket.
 
Is the Vesuvius active these days?
 
6:48 AM
Wrong kind of volcano IIRC. That's the kind that goes boom.
 
Stromboli?
Etna?
Kilaueua?
I accept donations to cover for the travel.
 
The Stromboli is so well known for going boom that a particular way of volcano going boom is named after it.
 
Seems the Etna is similar. No surprise really, it's all the same spot.
 
Where is a volcano like the ones you see in old movies set in prehistoric times when you need one?
 
user406009
6:52 AM
Hawaii? Don't they have easier to access lava there?
 
Hawaii seems like a good spot.
 
That would explain why non-European movies depict all volcanos like that.
 
Well
 
But then, they had Mount St. Helens.
That was a pretty big BOOM.
 
6:55 AM
On first approach it's true it's perplexing why volcanoes that go boom aren't more present in popular consciousness when historically we've had a lot of those near us in Europe.
On the other hand, there are far less witnesses to such eruptions/events left to tell the tale than when the lava flows slowly enough that people can go 'Oooh' and 'Aaah' some place near.
 
@LucDanton The lava has a massaging effect on them?
 
So, no one's willing to book me a trip to Hawaii? :(
 
The bread I bought on Saturday has become hard :(
 
That's normal.
 
I'll have to pretend it's crackers.
 
7:00 AM
I learned not long ago that a major process of bread getting stale is crystallization. So keeping bread cool has the opposite effect of helping.
 
Why would you want cold bread?
 
From experience I found that bread indeed seems to get old faster if I keep it in the fridge.
 
@RMartinhoFernandes That would be a side-effect of wanting not stale bread (if it worked), not an objective.
 
Oh. The idea of putting bread in the fridge never crossed my mind.
I don't mind stale bread.
 
I think you'll find that you're wrong on this one.
 
7:07 AM
What do you mean?
Are you saying I don't like stale bread?
 
@RMartinhoFernandes I find it convenient if everything edible is at the same place.
@RMartinhoFernandes You have a problem with that?
Any complaints?
 
@RMartinhoFernandes I'm saying you're wrong in general for writing horrible things. Horrible!
 
What did I do?
 
The horror!
 
OMG, am I going to hell for this (and what was "this")?
 
7:08 AM
Having to eat stale bread is worse than falling in lava.
*onto lava
 
Fresh bread is srs bsns.
 
Here in Belgium it is taken seriously.
 
So, what do you do if the bread goes stale? Throw it out?
 
I heard that in Holland you can buy bread in the supermarket that you can keep for a week. In Belgium such a thing would not even qualify as bread.
@RMartinhoFernandes Go to the nearest pond and give it to the ducks?
 
Poor ducks.
 
7:13 AM
The swans can get aggressive when bread is involved.
They pick on the baby ducks.
 
You consider other animals inferior beings that deserve to eat stale bread (which you seem to consider a capital offense).
I don't like you anymore.
 
But, but ... the water makes it soft again!
 
@RMartinhoFernandes I don't get stale bread because I eat it all. But sometimes French toast is nice to have.
 
@StackedCrooked Why don't you water it yourself and eat it?
 
7:14 AM
@RMartinhoFernandes The offense is letting bread go stale. And mentioning bread going stale.
 
@LucDanton Giving it to ducks is a way to redeem oneself.
 
@LucDanton Oh, that's traditionally on Christmas around here.
@LucDanton Ok, I shall stop mentioning it then. And to redeem myself, I'm out to buy fresh bread.
 
@RMartinhoFernandes It will vary a lot across regions. The first time I've had some, it was savoury and served at meal time. But apparently my friends only eat it sugary and they consider it a dessert.
 
@RMartinhoFernandes If stuff like this (don't know the English word for it) has gone stale you can put some water on it and put it in the oven. It's good.
 
7:42 AM
Can template<> "a full specialization I guess" be present in place of type parameter list ?
 
What?
 
template <
    typename T,
    template <
        template<class...> class... Policies
    >
>
class ICantBelieveItsNotButter;
Either a missing "class Name" or the "template< >" around the policies is too much. So much for "My code has no mistakes".
I'm unable to figure out the sentence after the "or" part from above sentence
 
Oh @Xeo wrote that
 
yeah , that nasty fucker xD
 
I think he means that it should be this:
template <
    typename T,
    template <
        template<class...> class... Policies
    > class
>
 
7:48 AM
@Pubby right I could figure out that , but what about the other option he proposed after "or" part in his sentence
 
Hmm, no clue
 
@RMartinhoFernandes you there?
 
It sounds like this: template<Policies> but that doesn't make sense
 
@Pubby Thanks for help though :) , yes that isn't making sense to me either :(
 
Heh, I didn't help much. Hopefully @Xeo will come back!
 
7:51 AM
Hi.
Like Andrei says, the code is correct (i.e. it's valid).
What's wrong is the thing that is named.
 
@RMartinhoFernandes Hi :)
 
template <
    typename T,
    template <
        template<class...> class...
    > Policies
>
class ICantBelieveItsNotButter;
"Fixed".
 
Wait, no need for class after template<>?
 
Oh, wait.
Maybe.
 
`template <
template<class...> class... // those last ellipsis shouldn't be there, should they ?
> Policies`
 
7:54 AM
Lemme look at the slide to see what was intended.
Anyone knows approximate time?
 
Xeo
It's in my comment
 
error: expected 'class' before 'foo' :(
 
Xeo
19:48
Pubby, gimme a sec
 
Give you a second to make 19:49?
 
Xeo
@MrAnubis The second part was to make it look like this:
 
7:56 AM
Ah, it needs to kill the template< > around it.
 
Xeo
template<class T, template<class...> class... Policies>
class ICantBlablabla;
Exactly what the robot says.
 
@Xeo aah
 
It's a bunch of templates with any number of arguments.
 
I think Andrei did in fact lampshade that his 'correct' code was missing class.
 
@RMartinhoFernandes I realize that , thanks a lot, I'll get you new batteries as gift :D
 
7:58 AM
Anyway, what Andrei said was that his code had no bugs.
I don't consider compiler errors bugs.
 
Xeo
@RMartinhoFernandes Oh, right.
 
It was when Bjarne, I think, mentioned something about exceptions.
 
@RMartinhoFernandes What, and he had the relevant slide handy?
 
No, it was not about that slide.
(But then, STL took note of the slide numbers)
 
ideone.com/Qe31c << class is required which contradicts the Anderi's reply
or again I got something wrong?
 
Xeo
8:04 AM
I asked him directly in a comment
 
Yes you need class.
That's the only place in the language that class is actually required.
template <template <class...> class...> class... VVVTTTs.
 
Xeo
@RMartinhoFernandes We already had that.
 
Wait, what?
 
lol Big authors (Andrie) of C++ never accept their bugs in code :D
 
Xeo
@RMartinhoFernandes I could swear I posted an ideone link to such an abomination once
 
8:10 AM
@RMartinhoFernandes That whole thing must be type parameter of some template class , right
 
Xeo
@MrAnubis Yes
Man, but I wish we could just do void f(int... ints)
 
@Xeo You gotta be kidding me. How did you survive the raptors?
That's gotta invoke raptors.
 
Xeo
@RMartinhoFernandes I fought them off with all the sharp angle brackets.
 
@Xeo Well, there's f(initializer_list<int>)
 
Xeo
And shot the dots at them.
 
8:12 AM
@Xeo it's equal to f(int,...,int); , ellipsis must be last formal parameter
 
Xeo
@MrAnubis Read again.
 
@MrAnubis He means variadic number of ints.
 
initializer_lists suck.
 
sbi
Most people in favor of either a 2016 or 2017 target date for the next version of C++. #wg21 #cpp
 
8:12 AM
I want my moves.
 
Most of the language sucks, but you gotta deal.
 
@CatPlusPlus Yes, but new features don't have to suck.
 
Also, it's damn cold outside.
 
Ha, the cold is gone here.
 
@RMartinhoFernandes It wouldn't be C++ then.
 
8:13 AM
I can stand outside without a jacket.
:P
 
@CatPlusPlus not my fault, He should choose good variable names xD
 
Xeo
Robot, remember my complaint about 300 missing rep?
 
Still in the cache.
 
8:15 AM
Ha, your rep got nuked.
 
Tsk tsk.
 
sbi
@FredOverflow Following Stephanus is almost like participating.
 
At least you got the badge, right?
 
Xeo
@RMartinhoFernandes Yeah. I wonder if Bill was kind enough to wait till I got both... :P Or if that was just coincidence
0
Q: nontypes template parameter

10001001058I have learned that:- Nontype template parameters carry some restrictions. In general, they may be constant integral values (including enumerations) or pointers to objects with external linkage. So i made following code 1. template <char const* name> class MyClass { ...

Close as dupe of the question that asks for all the non-type parameter possibilities?
6
Q: Non-type template parameters

MaheshI understand that the non-type template parameter should be a constant integral expression. Can someone shed light why is it so ? template <std::string temp> void foo() { // ... } error C2993: 'std::string' : illegal type for non-type template parameter 'temp'. I understand wha...

Namely this one
 
I don't think so.
 
Xeo
8:21 AM
Hm, right
 
It's not the same question, and you can't really find the answer on the other one.
 
Anyone know what symbol Î means? It's used like this: {x Î S | ...}
 
What context?
 
Sets/logic I guess. It's from a book on types
Here's a sentence it's being used in: We say that the elements s1 Î S1 through sn Î Sn are related by R if (s1,...,sn) is an element of R.
Could it be the membership∈ symbol?
 
sbi
Oh, and:
Variadic templates talk video now available: http://www.reddit.com/r/programming/comments/pe4d8/goingnative_2012_on_demand_andrei_alexandrescu/
 
8:24 AM
@Pubby That's a possibility.
The sentence makes sense with that.
> I'm gonna show parametrized parametrized factory factory to my Java-liking friends just to aggravate them.
 
I can't even read this sentence.
 
@RMartinhoFernandes Here's another sentence: A one-place relation on a set S is called a predicate on S. We say that P is true of an element s Î S if s Î P.
 
Your encoding is probably gone bananas 🍌.
Yeah, that's definitely membership.
 
Alright, I guess it's just html rendering it funny
 
Xeo
Call Your Headhunter! /via @BartoszMilewski http://j.mp/yFDx7D
This one's also nice
 
sbi
8:38 AM
@RMartinhoFernandes Stromboli is nice to be on at night. I was there, in the 90s, carrying a baby on my back, when we went up in the night. Quite impressive.
@StackedCrooked It's -10°C here, too, this morning. 6° warmer than yesterday morning.
 
sbi
@RMartinhoFernandes Haha, nice one, that!
Anyway, gotta take a shower and go to work.
afk
 
8:55 AM
This is surprisingly confusing after looking at Haskell all day: std :: string s;. Never knew people added spaces there.
 
morning
 
morning peeps!
 
Oh wow, that guy puts spaces in array and function notation too.
 
@RMartinhoFernandes nice video
 
8:59 AM
@Pubby he must have a white space fetish
 
hi robot
 

« first day (479 days earlier)      last day (4467 days later) »