« first day (239 days earlier)      last day (4699 days later) » 

12:00 PM
2
A: Environment Variables are in a char* how to get it to a std::string

DeadMGYou do not want to use sizeof() in this context- you can just pass the value into the constructor. char* trivially becomes const char* and you don't want to use strcpy or printf either. That's for conventional C-strings- however GetEnvironmentStrings() returns a bit of a strange format and you ...

this question is NOT a dupe
for chrissakes
 
i closed it as a dupe
 
then you're wrong.
 
wait, I'm just kidding!
 
getenv is equivalent to GetEnvironmentVariable()- somewhat, still not enough to warrant duping though, and it's definitely NOT equivalent to GetEnvironmentStrings()
 
Xeo
10 mins ago, by Xeo
Am I the only one not understanding the already 4 close votes on this question ?
glad I was not the only one
 
12:08 PM
0
Q: How to disable warnings for particular include files?

Johannes Schaub - litbI wold like to disable particular warnings for all files that are included, directly or indirectly, by particular include files. For example, I want to disable the warning "you are assigning a string literal to a char*", for all files or files included by files included by a #include <bar/*>...

 
cpx
@JohannesSchaublitb there's a picture at bottom at end of the article, maybe it randomly selects one picture from wiki article.
 
@JohannesSchaublitb What code is it that you are including?
Coworkers?
 
@FredOverflow i prefer not to say that
 
@JohannesSchaublitb Girlfriend?
 
12:16 PM
mother in law?
 
perhaps / perhaps
 
both?
 
@JohannesSchaublitb Would -isis (for GCC) satisfy your needs? It is similar to -I but files included from there are considered system headers and do not produce warnings.
 
perhaps
perhaps it's YOUR (!!) code
 
It may not be applicable if you have headers you do want warnings from in that same directory
 
Xeo
12:17 PM
> I can live with all warnings being disabled for that file.
From @Johannes comment
 
@JohannesSchaublitb Why would you use my code? And I'm pretty sure I haven't bound string literals to non-const char* for years.
 
Xeo
Seems the -isis seems fitting
@FredOverflow He found your old code.
 
Isis or in original more likely Aset () was a goddess in Ancient Egyptian religious beliefs, whose worship spread throughout the Greco-Roman world. She was worshipped as the ideal mother and wife as well as the matron of nature and magic. She was the friend of slaves, sinners, artisans, and the downtrodden, and she listened to the prayers of the wealthy, maidens, aristocrats, and rulers. Isis is the goddess of motherhood, magic and fertility. The goddess Isis (the mother of Horus) was the first daughter of Geb, god of the Earth, and Nut, the goddess of the Overarching Sky, and was born...
 
@Xeo But if there are legitimate files in there you would need e.g. to resort to symlink trickery
Oh yeah
It's -isys
 
i found some codes of you with comments on the top "This is my kindergarten file. Exercises from C++ in 21 days"
 
12:19 PM
For uh obvious reasons
 
@Johannes The picture of the pyramids also can't be found in the Wikipedia article, btw :)
 
ohh
perhaps a meta question is in order?
 
If it's that important to you, why not...
 
cpx
12:30 PM
no not in that one.
 
Xeo
Oops! Your question couldn't be submitted because:

    must include one of these tags -- 'bug feature-request discussion support'
lol
 
Xeo
@cpx Okay, and how does the chat get to that thumbnail?
 
cpx
not sure
 
Xeo
Oh well, I just had to ask. :)
 
12:33 PM
Second link in the article
But how did it get there..
 
lunchtime! nom nomsies
 
Well actually
Found it.
It's at the bottom of the article, you have to show the part where it says Ancient Egyptian Religion
 
cpx
ah, that was my first guess.
 
Xeo
@KhaledNassar Isn't in there for me
 
@Xeo You need to expand the bar
 
Xeo
12:44 PM
Oh, that small icon!
 
cpx
its really tiny image, you have to click 'show'
 
@Xeo Yes.
 
Xeo
Holy ...
Totally overlooked that
Does it take the last image from an article or what?
 
Oh my, code pasted as a quote.
 
I don't know.
I'm looking into the previous article.
 
Xeo
12:46 PM
Lets test this
C
C (; named cee) is the third letter in the basic modern Latin alphabet. History {| class="wikitable" |- ! Phoenician gaml ! Arabic ' ! Hebrew gimel ! Classical Greek Gamma ! Etruscan C ! Old Latin C |- style="background-color:white; text-align:center;" | | | | | | |} ‹C› comes from the same letter as ‹g›. The Semites named it gimel. The sign is possibly adapted from an Egyptian hieroglyph for a staff sling, which may have been the meaning of the name gimel. Another possibility is that it depicted a camel, the Semitic name for which was gamal. In the Etruscan language, plosive conson...
 
cpx
I guess it can't be random so maybe be.
 
It isn't random
I believe it's the last picture in the article
 
Xeo
@KhaledNassar Okay, but what with the C article I (accidently) linked?
 
More specifically the last <a> tag with the attribute class="image"
@Xeo I haven't checked that yet.
@Xeo The excerpt from the article seems to be the C letter itself o.o
 
Xeo
12:51 PM
Yea
I posted the C++ wiki link
but it got truncated to the C one. :|
 
Well that doesn't help..
In mathematics, a Taylor series is a representation of a function as an infinite sum of terms that are calculated from the values of the function's derivatives at a single point. The concept of a Taylor series was formally introduced by the English mathematician Brook Taylor in 1715. If the Taylor series is centered at zero, then that series is also called a Maclaurin series, named after the Scottish mathematician Colin Maclaurin, who made extensive use of this special case of Taylor series in the 18th century. It is common practice to approximate a function by using a finite number ...
 
Xeo
It seems ... kinda random
Maybe it even selects different images after the cache is cleared on the server?
Btw @Khaled, your answer would better fit the new question I'm going to ask soon. :)
Or not, as I suddenly lost my motivation to do so, lol.
 
I checked some wikipedia links from previous chat history.
It seems consistent with the pattern that I suggested.
 
cpx
Maybe it selects a picture by a size that fits into the text.
it doesn't really bother me.
 
@cpx Wikipedia pictures have that small thumbnail version of the image in the File history section.
So it wouldn't matter, could simply extract it from there.
 
 
1 hour later…
2:08 PM
operator precedence, && comes before !=, right?
 
!= binds stronger, (a != b && c != d) is equivalent to ((a != b) && (c != d)). Tip: if you're not sure about the precedence, use parenthesis.
 
cpx
This is a list of operators in the C and C++ programming languages. All the operators listed exist in C++; the fourth column "Included in C", dictates whether an operator is also present in C. Note that C does not support operator overloading. When not overloaded, for the operators &&, ||, and , (the comma operator), there is a sequence point after the evaluation of the first operand. C++ also contains the type conversion operators const_cast, static_cast, dynamic_cast, and reinterpret_cast which are not listed in the table for brevity. The formatting of these operators means that their p...
 
2:46 PM
Anyone here using Xcode 4?
0
Q: set system search path in Xcode 4

Konrad RudolphI’m trying to set the header search path in Xcode 4 (using LLVM 2.0 / clang as compiler) in a C++ command line project so that I can include a library header file via #include <foo>. If I include the search path under the build setting “Header Search Paths” then the header is found. Unfort...

 
3:40 PM
Damn, keep forgetting std::forward does not infer the template arguments.
 
@MartinhoFernandes How could it? The function argument to forward is always an lvalue, so...
 
Sure, I know. I just keep forgetting it.
And the compiler does not help at all.
 
Really? Shouldn't the compiler complain with an error if you forget?
 
It does, but the error is a bit confusing.
At least to me.
It says something like: "Could not resolve overload for std::forward(T&). Candidates are T&& forward(typename remove_reference<T>::type& t);
 
Xeo
4:04 PM
@AndreyT: You didn't have to delete your answere here. I edited the original question, which had no statement if extension or direct opening is meant
Do you know if people who not visit the chat also get notified?
 
I think they'd have to be here recently.
 
@Xeo I don't think so.
 
Xeo
Uhm. how do I invite a user in the chat?
I know there is such a feature, but...
 
There is?
Go find an old question of his, and comment ;)
 
I feel like I should do the transition to C++0x.
But I'm quite hesitant to do so.. :/
 
4:10 PM
Do it! Do it! Do it!
 
It has lambdas and other cool stuff.
 
Xeo
It has auto!
 
Wow, looks like I'm late for the party :D
 
Xeo
And variadic templates, but that's generally only cool for template-lovers like me.
 
lambdas, rvalue references, variadic templates, static assertions
it's a massive pile of yay
 
4:12 PM
The only thing that really got me interested is variadic templates and rvalue refs.
Alright then
C++0x it is!
 
MSVC2010 has no variadic templates. :(
 
oh, move semantics are really important, especially when you consider non-copyable classes
@CatPlusPlus: They (rightly, IMO) decided that lambdas and rvalue refs were more important
 
@DeadMG And those, I just read about them today (not much though), and it seems like a really amazing improvement.
 
@DeadMG Well, I agree with them. But still, can't play with those. :(
 
Damn..
 
4:16 PM
@DeadMG Pity they made it buggy.
 
Xeo
Hm. I know of implicitly declared move constructors that just do member-wise moves... but how does that work for primitive types? What value do the moved-from member have?
 
made what buggy?
@Xeo: Undefined
or maybe it's just the same as it was before, so effectively a copy
 
I heard they fucked up overload resolution with r-value refs or something. I don't use it, so I don't know for sure what it was.
 
you can't really "move" memory
@Martinho: That was completely the Standard's fault
what you have to remember is that MSVC implemented this stuff before the Standard was complete
and the at-the-time specification of rvalue references had a couple problems that were unknown at the time
 
Ok, so it's not their fault. But it's still a pity.
 
4:17 PM
their implementation is completely compliant to the rules that existed at the time
oh yes
and the nested lambdas rules suck too
and their libraries haven't exactly taken advantage of all the features
for example, if you instantiate std::map with a key that isn't comparable, it's a massive error message
but you can quite trivially use static_assert to make it error quickly and cleanly
 
sup geeks?
 
@DeadMG Oh, gotta start using static_assert myself. Man, C++ has so many features I keep forgetting about them.
 
oh yeah
 
Xeo
I keep forgetting that static_assert is implicitly a if (!expr) not a if (expr)
 
your compiler will quickly correct you ;p
 
Xeo
4:21 PM
And on the first compile scratch my head why it won't work
 
lol
 
Xeo
loL
 
hi everyone, just a quick question regarding compiling and running a c++ mfc project in visual studio 2008, i add my .h and.cpp files to an empty project, i then set the project to use a shared mfc dll, but when i compile and run the project i get this error: "error C2146: syntax error : missing ')' before identifier '¦'"
 
4:23 PM
Ouch, MFC. I pass.
 
any ideas what the root of that utterly annoying error is?
haha
 
It looks like a syntax error, doesn't it? And nobody can really help without some code sample
Also why don't you ask a question?
 
Just testing that i can use from iPad
 
Xeo
¦ -- now that's an interesting identifier.
I wonder what it does
¦3
 
the code is copied straigt from a book
 
Xeo
4:24 PM
¦D
 
On my keyboard, | is ¦.
 
Xeo
room topic changed to Lounge<C++>: lol
 
@Neville In general C++ books suck so much I don't find it strange that you can't compile an example taken straight from one.
 
Xeo
Eh. You're actually right
 
@MartinhoFernandes So true.
 
4:25 PM
thanks
haha
 
you know
over the last two weeks, I have earned an obscene amount of rep
 
static_assert(sizeof(_Tp)>0, "can't delete pointer to incomplete type"); fails with "error: invalid application of 'sizeof' to incomplete type 'X'"
lol
 
unique_ptr can already throw on attempting to delete an incomplete type
I mean, fail to compile
 
That was from the code of unique_ptr.
 
oh
lol
well, it does serve the function of throwing if _Tp is incomplete
 
4:34 PM
And the compiler error does lead one to the cause.
 
Xeo
@MartinhoFernandes Gotta admit, I smirked while reading that. Same would happen with a simple sizeof(T) statement, no?
 
I guess.
 
Xeo
I like it when something doesn't work the way I want it too, but achieves the same result still.
 
I just reworked a C(++) SourceForge question into an example. Should I put it somewhere else here, or just leave it as is? stackoverflow.com/questions/6311016/…
 
it's a valid question and has an answer, so leave it
no, wait
you edited it so there's no question?
then delete it, examples do not belong here
 
4:49 PM
pretty much - I was thinking of putting a pseudo-one at the top
ok
easy to turn into a question
ok, fixed it up - can't accept my own answer for 2 hours tho
 
nor should you
the other guy went to the effort of answering your question
the least you can do is leave it there so that other people who find his answer useful can upvote it
you should leave the original post as it was
 
yea I realise that now - I originally intended to turn it into an example but I guess I should've put it somewhere else
I guess I could restore it.
hmm can't restore past a name change - oh well
 
5:08 PM
std::begin(x) or x.begin()
?
 
Ok restored - yay for saving all posts locally before posting.
 
5:24 PM
Anyone good with -rpath,$ORIGIN here? Specifically, if I'm using it recursively, does the .so's $ORIGIN point to itself or the executable linking to it?
 
hello
any waf users here?
anyone knows how to bring boost.py into the waf script?
 
Xeo
@MartinhoFernandes Depends, do you want to support c arrays?
 
@Xeo Good point.
 
Xeo
if not, no need for the free function
 
What if I'm not writing template code (i.e. the type of x is well-known).
 
Xeo
5:28 PM
it calls the member function for containers anyways.
member function
the free function versions are only there for template code / range-based for
 
5:47 PM
figured it out: ./waf-light --tools=compat15,boost
 
Does Intel Composer XE 2011 support C++0x?
D'oh, forgot to add -std=c++0x flag. :')
 
yes
 
Xeo
6:22 PM
I love throwing the standard at people who don't believe me .. std::string evil_laughter = "muhahaha";
 
A fully printed standard can hit hard.
 
@StackedCrooked If you can lift it.
 
I person with no
hands would be able to do it.
 
Xeo
@MartinhoFernandes C'mon, it's only ~1000 pages! Way better then the reference manual for the mactini
 
FDIS goes to 1320 pages
 
6:33 PM
I just found the most hilarious thing here: reddit.com/r/firstworldproblems/top/?t=all
First world problems :D
"When I put my spoon into my empty pudding cup, it tips over."
 
Xeo
 
@Xeo: If you read the full section, I think that it's actually somewhat ambiguous
 
Xeo
okay...
 
because, the FDIS at least, clearly states that there is no semantic difference between class and template when dealing with template-parameter
 
Xeo
Sure, template parameters. But we're talking template template parameters here. Also, for the normal ones, it is explicitly stated that both are allowed, while for template template ones, it's not.
 
6:39 PM
template template parameters are included in template parameters
 
They should onebox reddit links in chat
 
7:17 PM
Template on a functor or use std::function straight up?
 
I recommend templating
std::function comes into play for e.g. binary stability
 
@LucDanton Sorry, can you elaborate what that means?
 
It's the difference between writing a template that accepts iterators and a function that accepts int*
the first one works with a variety of types but the second one can be compiled once and the resulting object/library/whatever can be used and reused
 
Xeo
Also, I'd avoid function until you really need it, e.g., until you must support either member function callbacks or functors. Or need a stateful functor. Though you can support the first through the second (like bind, which is a functor)
Most of the times, a simple function pointer will do. especially with lambdas
 
sbi
7:33 PM
Have any other high-rep #stackoverflow users seen an increase in the number of votes to old posts in the last several weeks?
Has anyone else here seen this?
@jcoehoorn Yes; quite a few more votes, actually.
@JamesMcNellis @jcoehoorn in particular my more popular old answers are getting hit. One in particular gets several votes a week
It happens to me, too.
 
Xeo
Hm, yeah. A bit.
 
sbi
I got 10 upvotes on old answers during the last 4 days.
 
Xeo
Well, you can only get upvotes on old answers, obviously
 
I saw old questions on the main page, that's probably why they get more views and more votes
 
Xeo
It's not too bad
 
sbi
7:37 PM
@Xeo I mean upvotes to answer that are older than a few days. Really, most of them are months old.
 
Xeo
Questions tend to submerge really fast once they have an accepted answer. Sometimes, it's sad, because the question / answer was really great
@sbi I meant you specifically
 
sbi
@Xeo Yes, they do. I usually get upvotes for a few hours, and then a question is forgotten.
Or I get upvotes to old, but favorite answers. And of those latter ones I get notably more recently.
Maybe this warrants another trip to the madhouse to find out what's up.
 
Xeo
Often, I find good ones when I search through profiles of high-rep users
It's always a joy to read them.
 
sbi
@Xeo Yeah, I used to do that, too. And so did others. There has been a constant dribble of upvotes on old answers since I started to have old answers. But I feel like it's been increasing recently.
 
Xeo
Well, I'd only worry about it if those upvotes on old answers would get me to my repcap on a per-day basis.
Without doing anything else.
 
sbi
7:44 PM
@Xeo I wouldn't. :)
 
sbi
7:58 PM
0
Q: What could increase the upvotes on old answers I am getting?

sbiLooking at my rep tab it feels like I am getting a lot of upvotes for older answers recently. In the last month I have only given about a dozen answers, which earned barely above 30 upvotes, yet my rep has increased by more than 1000. I don't feel like there was a comparable rep reap on old answe...

 
hello, I like the new room topic! lol
 
sbi
@TonyTheTiger And I had thought you, in particular, would have like the one before much more.
 
@sbi lol, yea I did like it, but not explicit enough :P
 
I tried to reverse it, but it wouldn't let me.
 
sbi
@CatPlusPlus "it"?
 
Xeo
8:12 PM
ti
@CatPlusPlus works
 
The topic.
 
who changed the room topic anyways?
 
Xeo
lifts his hand
 
sbi
@CatPlusPlus You tried to reverse the room topic that was before this one?
 
No, this one.
 
sbi
8:13 PM
@Xeo You shouldna have done that. (Raising your hand, that is.)
 
Xeo
I had the right to, since I already made the old one!
Noone in here seems to follow the rule to change the topic every 24h at max
 
sbi
@Xeo Your old merits do not necessarily give you new rights.
 
room topic changed to Lounge<C++>: lоl
Oh, this works.
Now guess what I did.
 
sbi
@Xeo I used to, but I was pretty alone in pushing for that. Now it's the turn of you young folks to keep it up.
 
Xeo
Here be ponies.
@sbi Eh, already tired, old man?
 
Xeo
@sbi I did?
 
sbi
@Xeo Ah, I should have waited a few more mins. :)
 
room topic changed to Lounge<++C>: Reversing the polarity.
 
sbi
@CatPlusPlus Gotcha!
 
8:22 PM
@sbi Nope.
Got*cha*.
 
sbi
If there's something indicating that you got me, it went over my head. (Which is easily possible. I had a hard day shepherding a bunch of kids.)
 
@sbi did they tire you out?
 
sbi
@TonyTheTiger Yeah, that's what I tried too say. I think.
 
@sbi ah yes ok.
I watched Stephen T.'s first Advanced STL lecture on Channel 9 the other day and I must say I didn't find it that easy. What did others here find of it?
 
sbi
@TonyTheTiger I'm sorry if that came across snappy. It wasn't meant that way. I guess, I'm tired.
 
8:28 PM
@Tony: I found it ludicrously easy
 
@sbi didn't come across that way at all...
 
I was actually very disappointed in that series in general
especially the last one
and found it very un-advanced
 
@DeadMG oh, then I guess I'm just not very educated in Type Erasure etc...
@DeadMG what would you consider advanced then?
 
I dunno
 
Frogs.
 
8:30 PM
but certainly not inheritance 101
 
sbi
@DeadMG Type erasure isn't exactly inheritance 101.
 
I'm pretty sure that "When you refer to a base, it might actually be a derived" pretty much is inheritance 101
 
sbi
@DeadMG Yes. But type erasure isn't exactly inheritance 101.
 
what's type erasure if not not knowing the type of what you're referring to?
 
sbi
@DeadMG What's template meta-programming but a clever application of boring and well-known techniques like template specialization?
 
8:39 PM
a healthy dose of compiler-specific implementations, SFINAE and decltype?
I dunno, maybe I'm just an advanced user who groks advanced STL very easily
 
sbi
@DeadMG I wouldn't know, since I haven't watched any of STL's lectures. However, having taught C++ to people with a very diverse background for about a decade I don't believe for a minute that type erasure (or what the C++ crowd understands of the term) is inheritance 101.
 
that's true
 

« first day (239 days earlier)      last day (4699 days later) »