« first day (909 days earlier)      last day (4037 days later) » 

Ell
2:00 PM
"Any book with c++11 is good for a beginner, agree or disagree?" <--- this is what he means
 
@tom_mai78101 omg cover
 
@ScottW Just saying. The Java industry has now been split into two demographics. The Android group and the Java group.
@kbok HE WILL BE BACK!
 
Ell
also lol@ "For the Java Development Kit (JDK) 10 or after, a fundamental change is being discussed: making the Java language Object Oriented."
 
@Ell yes, but you inversed it
 
@BartekBanachewicz s/C\+\+11/C\+\+/
 
2:01 PM
@Abyx come on!
 
Eh, should I put function_traits in functional/ or type_traits/?
 
Both! No idea.
 
Ell
@EvgenyPanasyuk it doesn't matter. Either way the way you said it originally was quite easy to misinterpret
 
What is in it?
 
Ell
But it's all sorted now
 
2:02 PM
@Ell, yes, you are right - you get what I meant
 
@R.MartinhoFernandes // With help from Martinho Fernandes.
Line 6.
 
@EvgenyPanasyuk so will you answer my question now?
 
No, I mean, what traits?
Oh...
 
@BartekBanachewicz "If the book doesn't have C++11, it's bad for a beginner. Agree or disagree?" - disagree
 
2:03 PM
The function qualifier crap?
 
@LucDanton I personally would put them in traits, sounds the most natural to me.
 
It's the FunctionQualifiers magic which allows for FunctionQualifiers<AddConst, void()>.
@R.MartinhoFernandes Ye
 
type_traits.
 
You want traits -> go include type_traits
 
@EvgenyPanasyuk for a beginner in C++, right?
 
2:03 PM
@R.MartinhoFernandes Def. agree.
 
Ell
@EvgenyPanasyuk Why would a beginner learn an outdated language?
 
@Ell C++03 is not an outdated language.
 
user484068
@R.MartinhoFernandes Interesting, a real Unicode regex example!
 
^this
 
@R.MartinhoFernandes it is.
 
2:04 PM
I'll also rename it to function_qualifiers and think about a place to put signature_size.
 
@EvgenyPanasyuk then I'm done here. Just don't fucking recommend outdated books to beginners here.
 
@Ell I didn't said that it should learn outded langauge. I mean't that C++03 book, can be better for beginner than some C++11 book
 
@R.MartinhoFernandes it is
 
I think we can end this C++ debate now with this book here.
 
Ell
@R.MartinhoFernandes I would say it is. It has been outdated by C++11
 
2:04 PM
@EvgenyPanasyuk but it will never be better than good C++11 books
 
@BartekBanachewicz "but it will never be better than good C++11 books" - agree
 
@BenHanson In the interest of full disclosure, I know of alternatives that do work: gist.github.com/rmartinho/cea973f04c284d0a234a
 
user484068
@R.MartinhoFernandes Well, don't mix utf-8 with char based regex certainly. Even with the wide version, Unicode support in C++ is hardly stellar.
 
user484068
@R.MartinhoFernandes - Right, ICU.
 
@EvgenyPanasyuk phew. now update your "recommend to noobs" title, whether it's Primer or not
@ScottW I fight for noob rights!
 
2:06 PM
@BenHanson "Well, don't mix utf-8 with char based regex" then why would I want <regex>?
 
user484068
Surely there's a wide version in there?
 
52 secs ago, by Ben Hanson
@R.MartinhoFernandes - Right, ICU.
 
@BenHanson That behaviour I describe in the answer is according to spec, AFAIK.
 
Heh, the function_traits.hpp include typically appears after all the type_traits/*.hpp includes. Quite telling.
 
@BenHanson Wide is unlikely to have a version of any library at the current time.
4
 
2:08 PM
(And yes, "useless" in my tweet is a bit exaggerated; but not much)
 
user484068
@R.MartinhoFernandes It would turn into a long conversation really quickly! I'll have a quick look though.
 
@DeadMG Good communication with the community right here. I approve.
 
Xeo
@StackedCrooked: Okay, I'm trying to convert that stone-age benchmark to modern timings, and I can't get anything useful out of it... :<
 
@Ell You think so? Look around you and tell me that C++03 is no longer in use. @Bartek @Abyx
 
Xeo
I know std::chrono::high_resolution_clock is only accurate to a millisecond (on MSVC), but still
 
Ell
2:10 PM
@R.MartinhoFernandes I'm not saying it's no longer in use, but why learn an old version when there is a newer, better (imho) version?
 
@R.MartinhoFernandes Windows XP is still in use
 
Of course, you can always claim you prefer to reject reality.
 
Ell
people use outdated tools/languages/etc. all the time
 
@R.MartinhoFernandes so is gcc2.6
now tell me gcc2.6 is not outdated
 
I won't even bother. You know quite well that is a terrible comparison.
 
user484068
2:11 PM
@R.MartinhoFernandes Yeah, there is a wregex. Obviously that is just less shit though, rather than a full solution. 'L' prefix needed for regex strings, obviously and if you're on Windows, then you're pretty much screwed as UTF16/UCS2 whateverthefuck.
 
"New version came out, let's forget about the old version and just use the new version" is not a software lifecycle strategy.
 
damn
I keep accidentally writing Wide as if it were C++
like a function taking a pair of int.
 
@LucDanton Especially since the new version of the software is still not out.
 
@R.MartinhoFernandes I am not so sure. The fact that C++03 is still used is orthogonal to the fact of C++03 being a viable alternative to modern languages
@R.MartinhoFernandes the language software are compilers obviously
 
@BartekBanachewicz The fact that C++03 enjoys vastly more use than C++11 is not orthogonal.
 
2:13 PM
@R.MartinhoFernandes So, delusional thinking instead of wishful thinking then?
 
Ell
Let's define "outdated" first :P
 
In my delusions I have member ref-qualifiers :(
 
@R.MartinhoFernandes it is in use. even VC++2005 is still in use.
 
@LucDanton Exactly!
 
@Ell Outdated: Out of date; obsolete.
 
2:13 PM
@R.MartinhoFernandes because of legacy projects. We should look at new projects instead.
 
Speaking of, let's check out if that patch made progress.
 
Legacy code rewriting can be nonsense, yes
 
Ell
@tom_mai78101 I don't think outdated means obsolete
 
@BartekBanachewicz Exactly! Let's abandon everything.
 
but today, when choosing a language for a new project, is C++03 viable?
 
2:14 PM
@Ell Everyone else does.
 
@Ell Well, you said let's define the word first.
 
@R.MartinhoFernandes I haven't said that
 
@BartekBanachewicz Oh, DeadMGing now?
 
@Ell I took the definition from the The Free Dictionary.
 
@R.MartinhoFernandes That hardly makes sense for me, since I am not sure what aspect of Puppy you are referrign to now. This might as well be Barteking
 
2:15 PM
@BartekBanachewicz "but today, when choosing a language for a new project, is C++03 viable?" - there are new projects which do require to be compilable on old compilers.
 
Xeo
HALP I broke the benchmark :<
 
I object
 
@BartekBanachewicz Who's Barte King?
 
@BartekBanachewicz It's more or less moving the goalposts.
 
@R.MartinhoFernandes The lack of "outdated" definiton beforehand justifies that at least a bit, no?
 
2:16 PM
@EvgenyPanasyuk those are some crappy projects, with old crappy toolsets
 
Puppy in first stage of negative conditioning. Plan is progressing just as planned. Mwahaha!
 
@EvgenyPanasyuk update the compilers. That's easier than rewriting code.
 
@BartekBanachewicz I believe all respectable dictionaries agree on the definition.
 
@Abyx there library projects, not just end-software
 
Xeo
Okay, evidently, my PC is just too fast. Even millisecond precision is not enough.
 
2:17 PM
@BartekBanachewicz say this to customers of such projects
 
> Out of date; not the latest one.
 
@BartekBanachewicz Updating the staff is harder than updating the compilers
 
@Xeo QueryPerformanceCounter has the resolution of 10 cycles on my machine.
YMMV of course.
 
@Xeo You want to go Nano?
 
Xeo
I have a divide-by-zero in the benchmark due to my PC taking less than a millisecond on the test
 
2:17 PM
46
Q: C++ Timer function to provide time in nano seconds

gagneetI wish to calculate the time it took for an API to return a value. The time taken for such an action is in the space of nano seconds. As the API is a C++ class/function, I am using the timer.h to caculate the same: #include <ctime> #include <cstdio> using namespace std; int main(int ar...

 
@EvgenyPanasyuk fuck'em. they should support C++11 anyway, with #ifdef or whatnot
 
Eh, guess it's time for an actual type_traits/function_traits.hpp.
 
@kbok I am out. I am not going to discuss staffing problems.
 
@Abyx what about libraries which should be staticly linked, with same runtime as main app?
 
Xeo
@DeadMG Meh, I don't like dealing with QueryPerformanceCounter, always such a hassle. And high_resolution_clock on MSVC only has millisecond granularity.
 
2:18 PM
@BartekBanachewicz Fair enough
 
@BartekBanachewicz Ok, we can play by that then.
 
@DeadMG what? 10 cycles? its call costs 500 cycles
 
@Ell Because it is still in widespread use, vastly more than the new one.
 
@EvgenyPanasyuk it doesn't matter.
 
C++03 is parachronistic
there, I said it.
 
2:19 PM
Pretending C++03 is irrelevant since November 2011 is delusional.
 
I'm Googling that word right now.
 
@BartekBanachewicz Don't get me wrong, I think everyone should be using up-to-date technology as much as possible; still, some conditions make C++03 more interesting from a financial POV -- one of which is having a team of C++03 developers who won't train themselves
2
 
@kbok That's just the sad reality I refuse to accept
 
@BartekBanachewicz Which is irrelevant for deciding what is relevant to learn.
 
btw, QueryPerformanceCounter doesn't measure time.
 
2:20 PM
@R.MartinhoFernandes true. Wait, fuck, why did I agree T_T
I've lost.
 
It's like you're saying you want people to migrate to Windows 8, but from a financial POV, Windows 7 is the best decision.
 
@BartekBanachewicz Want to restart?
 
@tom_mai78101 It's more "GG no re"
 
Darn. :( I'll respect your decision.
 
2:22 PM
You could say that learning C++03 may not be a good choice because it gives you a different mindset than C++11, but that is not related to standard publication dates.
 
@BartekBanachewicz Fair enough; anyway, you choose where you work and this kind of mentality is easy to detect before you agree on working with a given team
 
@kbok Is this a good thing?
 
@kbok Welp, we have lundi for template wankery anyway :P
 
@BartekBanachewicz Yeah :)
@tom_mai78101 Choosing where you want to work? Uh, yes, I guess?
@tom_mai78101 It's not the same at all
 
Anyone has an opinion on what signature_size<void (C::*)(int, double)>::value should be?
 
2:24 PM
Also Legacy code restoration is being discussed on ACCU ATM
 
@LucDanton Eww.
 
wait no
 
@kbok Oh ok.
 
@R.MartinhoFernandes ikr
 
2:25 PM
@LucDanton sizeof(ptrdiff_t)?
 
@StackedCrooked Oh. That beats a.operator++(5);
 
@kbok Uh, probably not.
I guess signature_length would be clearer here but I'm mimicking std::tuple_size :(
 
Yeah, given the responses here, I don't think the name is great.
You were expecting either 2 or 3 as answer, right?
 
@ScottW ahahahha spot on
 
@R.MartinhoFernandes What do you mean, responseS? That's like two :p
 
2:27 PM
@LucDanton Wait, maybe I misunderstood what is it
 
Xeo
@LucDanton 2
 
speaking of nothing; I wanna smack every programmer who believes std::string is null-terminated in the face.
 
@LucDanton 3
 
argument_count
 
2:28 PM
@refp it may be
 
@refp Erm. It is?
arity
 
@refp Practically it is
 
I don't think it really matters either way, whichever it is anyone can +/- std::is_member_pointer<Signature>() or whatever the actual trait is.
 
Yeah arity
 
arity
 
2:28 PM
arity?
 
yeah arity
 
@refp cost of adding 0 for every c_str() call...
 
Is someone trying to tell me something? I'm sensing something here.
 
Return type is part of the signature too so signature_size counting just arguments is misleading
 
2:29 PM
@LucDanton arity
 
Xeo
@BartekBanachewicz Whaaaaat
 
@Xeo whaaaaat have I done wrong again? c_str() returns null-terminated one, no?
 
@LucDanton arity
 
@CatPlusPlus u smart
I love you guys, thanks for the feedback.
 
@BartekBanachewicz Well, "every c_str() call"
 
Xeo
2:30 PM
@BartekBanachewicz And c_str can't append '\0'
 
@refp void f(std::string s) { assert(s[s.size()] == 0); }
 
Might as well do it once and for all
 
@R.MartinhoFernandes nhaa, I'm talking about folks who believe that it's impossible to store a '\0' inside a std::string
 
@Xeo so it's basically required the 0 is in buffer, no?
 
Xeo
2:31 PM
@BartekBanachewicz Yes
 
"I’m at the ACCU 2013 conference," "sorry if this blog post feels a bit rushed, I wrote it during lunch at ACCU 2013" "Now I'm off to see my friend Mike Long talk about legacy code base restoration projects"
YES WE FUCKING GET IT YOU MADE IT TO ACCU FUCK OFF
 
@Xeo so that's what I was pointing out: the fact of adding 0 every time is impractical, so std::string is null terminated
 
talk about the thing you want to talk about; nobody cares that you are at ACCU
 
@LightnessRacesinOrbit I'm at ACCU too BTW
 
@LightnessRacesinOrbit That's a public message.
 
2:32 PM
@LightnessRacesinOrbit Everyone here is except you
 
@tom_mai78101 What is? And so?
@kbok I know :(
 
I am so bad at this Internet thing.
 
@Abyx That doesn't prevent it from having a 10-cycle resolution.
 
@LightnessRacesinOrbit All your friends & family are there too
 
Xeo
@BartekBanachewicz It's not just impractical, it can't be done.
 
2:32 PM
@LightnessRacesinOrbit I'll be pulling the same shit next week at Bristol.
 
@LightnessRacesinOrbit You're just jell-- wait, déjà vu.
 
@LightnessRacesinOrbit Never mind then. I was thinking of "bloggers avoiding tirade" train of thought.
 
@Xeo if you mean that c_str is const, it could do a copy, no?
 
Also déjà vu is hard to type.
 
I am totally starting my blog posts with "BTW I am in Paris and the weather is nice" or something
 
Xeo
2:33 PM
@BartekBanachewicz no
 
c_str is O(1)
 
@DeadMG nah, if it reads memory, there will be a random latency > 10 cycles
 
Probably
 
Xeo
It's O(1) for one, and it can't append 0 even in a preallocated buffer
 
2:34 PM
@CatPlusPlus Is this the std::string c_str or the Cat Plus Plus c_str?
 
@Xeo why's the latter part?
 
@Xeo Why can't it append 0?
I've not seen any wording in the Standard that prevents it from doing so.
 
noexcept?
or someshit?
 
const and basic thread guarantees possibly.
 
Xeo
&operator[i] == c_str() + i for every i in [0, size()]
 
2:34 PM
@kbok It's defined by the standard to be O(1) fuck off
 
@kbok CatPlusPlus c_str?
 
@LucDanton Neither of those prevent appending 0 to a preallocated buffer of sufficient size.
 
@kbok "BTW I am in Berlin and they tell me it is Spring; what a bunch of crazies"
 
@tom_mai78101 inner joke
 
@BartekBanachewicz Must've missed it.
 
Xeo
2:35 PM
Oh wait, that was about pointer things
sec
 
@Xeo That does not prevent appending 0 at the end, it only requires that you would have to have pre-allocated enough space for it.
 
@tom_mai78101 Sorry; I don't get it
"I do not understand the sounds that are coming from your mouth"
 
Xeo
operator[](size()) == CharT() IIRC
 
I didn't mean for this to be a conversation about the internal representation of a std::string
 
@LightnessRacesinOrbit Thus, never mind then. :)
 
2:35 PM
5 mins ago, by R. Martinho Fernandes
@refp void f(std::string s) { assert(s[s.size()] == 0); }
 
@CatPlusPlus are you sure you should talk about programming
 
@refp that's how we roll
 
Xeo
And you can't cheat by storing the \0 somewhere else
 
2:36 PM
Yes, it can do crazies.
 
@tom_mai78101 I'll be wondering forever!
 
@Xeo You can for an empty one. And mmaping tricks.
 
We should store the static \0 just in case
 
Xeo
@R.MartinhoFernandes Wait a second, you were the one specifically saying it can't do that!
@BartekBanachewicz No
 
@R.MartinhoFernandes ... all I wanted was to say that I hate the following theoretic assumption; char const data[] = {'a','b',0,'c'}; std::string s1 (data,data+4); assert (s1.length () == 2); /* NO, THIS IS NOT IT! */
 
2:36 PM
@Xeo It can do some.
 
@DeadMG What if someone stores the result of data(), and reads p[size]? Sounds like a data race to me.
 
@LightnessRacesinOrbit Nothing. Please. :D
 
Yes, I am the perfect guy for designing Hell++.
 
@Xeo you are even worse at this internet trolling thingy than me
 
@BartekBanachewicz It can do that for empties!
 
2:37 PM
@R.MartinhoFernandes SSO, aha.
 
SSSSO
Static Super Small String Optimisation.
 
Very, Very Small String Optimization
 
VVSSO.
 
@LucDanton He is reading past the end of the string.
much like de-referencing end(), in fact.
 
2:38 PM
7 mins ago, by R. Martinho Fernandes
@refp void f(std::string s) { assert(s[s.size()] == 0); }
 
da fuck
 
@DeadMG De-referencing end is UB, but indexing at size isn't.
 
@R.MartinhoFernandes Is operator[] always guaranteed to return data()[size]?
cause if so, then why bother appending \0 at the end, it's obviously got to exist there permanently anyway.
 
why are you discussing something that is clearly stated in the standard?
 
@DeadMG They are defined in terms of each other. Not sure which way, but I don't think it matters.
 
Xeo
2:39 PM
7
Q: Is a std::string implementation conformant where 's.c_str() + s.size()' is not necessarily the same as '&s[s.size()]'?

Xeo§21.4.5 [string.access] const_reference operator[](size_type pos) const; reference operator[](size_type pos); Returns: *(begin() + pos) if pos < size(). Otherwise, returns a reference to an object of type charT with value charT(), where modifying the object leads to undefined behavior. Th...

btw
 
my "I hate" thing has nothing to do with incorrect code or UB, but about programmers who are stupid.
 
@refp we are discussing the standard, duh
 
> convineced
 
@BartekBanachewicz it's been discussed a million times, just search SO and you will find.. many questions
 
I don't like the OP's language either
 
2:39 PM
It's a barrier.
 
im almost conviedc to use git with visual stdio for src cntrol
 
@ScottW but he's almost convininineced!
 
Spelling is degrading in here.
 
> visual stdio
 
2:40 PM
why does this always happen to me? I write something small and insignificant and then; chaos in Lounge<C++>
 
@refp It's normal.
 
@refp meh, we would discuss some other shit
 
@tom_mai78101 it's not
 
@refp I want to believe.
 
@refp how oftern you are hier, execatelty?
 
2:41 PM
@BartekBanachewicz why don't you discuss some other (more interesting) shit?
 
Xeo
@refp Because some things are not clearly stated in the standard.
 
@refp Lift your head. Your bellybutton is getting embarrassed.
 
@refp like what?
 
@BartekBanachewicz often enough to be mentioned when I'm not here
 
@ScottW Pretty much this.
 
2:41 PM
@ScottW dereferencing null-pointer chaos, that's interesting.
 
Xeo
@refp std::is_same<Lounge<C++>, Lounge<Pedants>>() == true
 
@refp oooooohhhh you must be a regular
 
@BartekBanachewicz I'm also the most boring troll you will ever encounter
and black.
 
@refp No, you're not.
 
@ScottW because it might make me rich
@tom_mai78101 I'm not?
 
2:42 PM
@refp You still have room for improvement.
 
@tom_mai78101 alright true. I'm mostly brown
 
Ell
ahh well my definition is wrong then
 
/me: Whoosh.
 
0
Q: C++ HelloWorld Compile Error

montyjandersonWhen I try to compile my code I get an error. I followed this tutorial: http://www.youtube.com/watch?NR=1&feature=fvwp&v=EwvfBtC1nL4 #include "stdafx.h" #include <iostream> using namespace std; int main() { cout << "Hello World!"; cin.get(); return 0; }

 
 
2:44 PM
@ScottW I noticed.
 
^ me thinking of Lounge<C++>
 
@refp No head? Not gore enough. :(
 
> Some of editor (for example:eclipse) you must save file before compile it.
 
> Yoan Jouan
 
wise words of wisdom
 
2:45 PM
Poor guy, what a name
 
@tom_mai78101 head inside wall (it was a random hole next to my friends flat so I took a peek)
 
@refp Ah. I'm sorry. I am viewing from a phone.
 
Monty Janderson
his website, while incomplete, is pleasing on the eye. surprised he hasn't mastered the art of basic problem investigation
 
maybe I should have a picture of myself as my avatar, seems like all the cool people got one (of theirselves, ofc)
 
> PHP is a server-side scripting language used by lots of websites for secure logins
I ... don't even know where to start.
 
2:48 PM
@LightnessRacesinOrbit Let's start by discussing how indebt we are.
 
@LightnessRacesinOrbit it's not exactly a lie..
 
Ah, frames. And no semantic content. That's better.
@refp It infers properties on PHP that are not properties of PHP.
Okay, how about this:
> HTML is a scripting language to add the structural layer to the content.
 
@LightnessRacesinOrbit Like secure logins, right?
 
and this:
> CSS is a scripting language to add the presentational layer to the content.
 
@LightnessRacesinOrbit I'm just messing with you (and the Internet)
 
2:49 PM
@MooingDuck I meant to say that I have considered various options, but am not fully satisfied with my choice: there are cons of the current approach I don't want and pros of other approaches I do want. I need to give it more thought in the future. But I guess it does come across in a wrong way. Also, why am I replying to this now?
 
any new interesting questions on SO about C++11 lately?
 
@refp Unless you include the debate from some minutes ago, no.
 
First band I saw live. This is the actual gig -1992. I'm so fortunate they filmed this. I remember it like yesterday http://www.youtube.com/watch?v=LSYl6A-KLVU
@montyjanderson HE HE !! It is a good one!!! Well before you were born sonny!
 
2:50 PM
@LightnessRacesinOrbit you expect me to go through a list of thousands of not-so-interesting questions to find an interesting one? you have to much faith in me
 
There we go, then.
@refp I don't expect you to do anything, truthfully.
 
@BartekBanachewicz That video is godawful
 
@LightnessRacesinOrbit I know.
 
Let me show you a VS icon that takes entire screen while you listen to the soothing white noise in the background
Here's a menu, as you can see it's a menu
 
> C++ Tutorial (3) - Absolute n00b spoonfeed
 
2:53 PM
I felt stupid waiting on @CatPlusPlus to show a few screenshots.
 
K, I've seen enough.
 
@ScottW WUT
 
Argghh, spaces before punctuation. My eyes! Take it away take it away! Ia! Ia!
 
@ScottW he wants eclipse to save files automatically before building
 
@tom_mai78101 Same
 
2:55 PM
@ScottW it hate it .when people type .like that
 
@bamboon Oh boy, don't remind me.
 
g .g .
 
That's just retarded.
 
g. g.
 
"Hey guys let's make it easier to debug the wrong code".
 
2:56 PM
A window application is an application that works in a window, and console application is like a window application but works in a console window
 
@CatPlusPlus Man, show some screenshots. (I know you're trolling. Just please make it happen...)
 
@CatPlusPlus so what about applications which don't work in a console, but never create a window either? :)
 
I'm not ~trolling~ I'm paraphrasing that awful video
 
oh right
 
@CatPlusPlus What about applications that don't work at all
 
2:58 PM
oh.
 
I can't quote because I can't insert a background noise in the text
 
Try something like this:
 
@CatPlusPlus Thank god.
 
> A. .w.i.n.d.o.w. .a.p.p.l.i.c.a.t.i.o.n. .i.s. .a.n. .a.p.p.l.i.c.a.t.i.o.n. .t.h.a.t. .w.o.r.k.s. .i.n. .a. .w.i.n.d.o.w.
 

« first day (909 days earlier)      last day (4037 days later) »