« first day (648 days earlier)      last day (4316 days later) » 

7:00 PM
That's why you should never learn C before C++, for instance.
 
Xeo
@EtiennedeMartel I did
 
Do you think it's a good idea, in retrospect?
 
Xeo
And the first thing I groked about C was linked lists :D
That was when I was... 14? 15?
 
7:02 PM
@ManofOneWay, The concept is correct. I assume it was from when you used new, and people just didn't see it afterwards, or kept their downvote (which imo they shouldn't if you fix it).
 
OMG you're tainted.
 
Xeo
Btw, they changed the Link button to Share
:>
 
> It seems C++ treats unfair to argument types and return types?
lol
 
I'm crashing this computer currently by trying to run powershell in console2. Infinite crt error popups. Can't stop it. I'm looking at you, Martinho.
 
7:03 PM
@Xeo, Oh, I was looking for it last night, and couldn't find it.
Too late to realize share == link lol
 
@keith.layne I claim operator error.
 
I can't type fast enough to argue it.
 
2
A: Code can run but doesn't show the Result in Eclipse.?

FredOverflowchar* name = new char[MAX]; cout << "Enter name: "; cin.getline(name, strlen(name)); Calling strlen(name) will invoke undefined behavior, because you haven't initialized the array. Poor strlen will try to find the NUL character in an uninitialized byte mess. Definitely not a good idea. W...

 
@ManofOneWay probably leftover from pre-edits
 
^ converted "code that was accepted by a C++ compiler" to C++ code
 
7:05 PM
Works fine here.
 
@StackedCrooked Enter JavaScript with prototypal inheritance.
 
Ah, yes.
 
@R.MartinhoFernandes How was that "C with iostreams" code advanced? If anything, it was retarded.
 
Xeo
Mmm, close vote fail on my side
 
@Xeo Oh excellent! Thank you
 
7:09 PM
const byte value=B00110110;
How is that even possible?
 
@FredOverflow Pointers and C strings are advanced features.
@chris It isn't.
 
@Xeo, I've done that before once.
 
@chris Well, it is. With a truckload of constants.
 
@R.MartinhoFernandes Sure it is. Just define 256 constants named B00000000 through B11111111.
 
Beat ya to it :P
 
7:10 PM
Ohh, that fails hard.
L2C++11
 
One of my colleagues just unplugged his PC and left with it.
 
No.
L2Hex.
I don't want to see binary literals in code.
Those things are not readable, man.
 
That works too, but at least 00110110_b is valid in C++11.
@R.MartinhoFernandes, I agree, unreadable code ahead.
 
Xeo
@EtiennedeMartel Always an option!
@R.MartinhoFernandes You're a robot. Wat.
 
7:14 PM
@R.MartinhoFernandes, I'm throwing up inside.
Reminds me a bit of how boost handled tuples, except that's actually kind of cool.
 
Xeo
0
Q: does it make sense to define const scope_refptr()?

Helin Wangscoped_refptr<any_class> a_scoped_refptr; const scoped_refptr<any_class> = a_scoped_refptr; // Compile error. If it's const than we can not modify the ref_counter, but I want to imply that the content that the pointer points to should not be changed, what can I do?

> scoped_refptr
wtf, is that some kind of shared_ptr?
 
@ManofOneWay, You could put a free in there for good measure. None of the other answers have it.
had*
OP doesn't look like they know about the function, so at least knowing it exists is good.
Wow, someone has 3 C++ bounties up atm.
 
Aaaaaanyone have experience with static events in C#?
 

C#

General discussions about the c# language, Squirrels | gist.gi...
Join me there?
 
@Xeo scoped_shared_ptr.
 
7:22 PM
@R.MartinhoFernandes gladly, moving over...
 
http://www.boost.org/LICENSE_1_0.txt
Does that mean I can use parts of boost ( unique_ptr stuff ) and use it in a commercial application without providing the license file or copyright notice as long as the software is delivered as an executable with no source code?
 
I think that's the idea.
 
@JimNorton Does Boost have a unique_ptr?
 
> However, we don't need C++0x compilers to take advantage of move semanatics.
 
@JimNorton afaik, yep. I can't see how else to interpret it
 
7:25 PM
semanatics.
 
Oh, and I am not ANAL.
 
Anal yse.
 
@R.MartinhoFernandes Acronyms are hard for robots, I guess.
 
@EtiennedeMartel So? Just because Boost can emulate move semantics does not mean it has every move-enabled C++11 type in there.
On a side note, if the vector owns the actors, you probably want a vector<unique_ptr<Actor>> instead. Then you don't have to manually delete the actors anymore, the vector will take care of it. — FredOverflow 50 secs ago
 
4 mins ago, by Etienne de Martel
semanatics.
 
7:30 PM
@FredOverflow home.roadrunner.com/~hinnant/unique_ptr03.html
 
@EtiennedeMartel People make typos from time to time, get over it.
 
@Sam hmm, sorry, I'm not very fluent in WCF, so I don't think I can help you if Class.Event += lambda or whatever; doesn't help :S
 
@Xeo, How many hours ago were you supposed to go to sleep again?
 
@FredOverflow I just found "semanatics" to be quite a funny word. Especially in the Boost doc. Looks like they don't proofread that much.
 
@FredOverflow Typos are poople too.
 
7:31 PM
@JimNorton Ah, Howard Hinnant to the rescue :)
 
@R.MartinhoFernandes No problem. I'll just see if the C# channel will bless me with some feedback, see if I'm completely misunderstanding how what I'm trying to do works or not.
 
Xeo
@chris Huh?
Oh, yeah, that reading fail.
 
@R.MartinhoFernandes Like soylent green
 
Xeo
I'm really not up to par today
 
@Xeo, I'm like that at a certain point in time every day.
 
7:35 PM
@R.MartinhoFernandes What do you mean by , operator? I'm just looking at isthe.com/chongo/tech/comp/c/c-precedence.html
 
@ManofOneWay In f(1,2), the comma is not an operator.
Precedence doesn't apply.
 
Oh okey
 
In f((1,2)), the comma is an operator.
Yes, it's crazy. I don't make the language.
 
@ManofOneWay I like to draw this picture:
              NOT the comma operator, but a declarator separator
              |
              v
for (int i = 0, j = 10; i <= j; ++i, --j)
{                                  ^
    f(i, j);                       |
}      ^                           comma operator
       |
       NOT the comma operator, but an argument separator
7
 
@FredOverflow, Perfect picture.
 
7:38 PM
@FredOverflow That's gonna look great on the starboard.
 
The comma operator evaluates its left argument, throws the result away, and then evaluates its right argument.
 
Eh, can just click the time for the post.
 
And the argument operator evaluates in which order the compiler may like?
 
It's not an operator, dammit.
 
Xeo
@ManofOneWay *seperator, not operator
 
7:39 PM
It's just a comma used to separate things.
 
Yes sorry
 
@ManofOneWay, Besides that, yes, it's unspecified in what order function arguments are evaluated.
 
unique_ptr<int, void (*)(void*)> p((int*)std::malloc(sizeof(int)), std::free);
Yay, C meets C++11 :) found here
 
@R.MartinhoFernandes back to life. With a console, no less.
 
Xeo
@FredOverflow :O
 
7:41 PM
@Xeo What?
It's not part of the code, it's a textbook example of custom deleters.
 
Xeo
I looked at the source after that
 
> The C++11 unique_ptr makes use of a new C++ langauge feature called rvalue reference
 
^ very convenient
 
@EtiennedeMartel I thought you might find this amusing ;)
@TonyTheLion fake, right? still funny
 
7:45 PM
donno if its fake
 
Probably is, those are so very easy to make.
 
@FredOverflow You forgot to add this:
 
@FredOverflow I once witnessed my friend's Mac hanging midway through attempting to display their fancy version of a BSOD because of another crash.
 
@R.MartinhoFernandes, Gud1 apple.
 
enum {
  foo, bar
  // ^ NOT the comma operator, but an enum value separator
};
 
7:46 PM
@R.MartinhoFernandes Why does this remind me of "destructors should never throw"?
 
enum {
  foo, bar
  // ^ NOT the comma operator, but an enum value separator
                          // ^ NOT the comma operator, but a comma in a comment
};
 
@R.MartinhoFernandes lol
 
   ;
// ^ NOT the comma operator, but part of a semicolon
 
You guys are killing me today :)
 
7:48 PM
s/a semicolon/the most feared punctuation on Earth/ FTFY
 
^ NOT the comma operator, but a blinking eye
 
Semicolons are great; they allow you to omit some words.
 
@R.MartinhoFernandes not ANAL my ass
 
They also allow you do chain statements.
 
Ironically, I started using semicolons a lot after giving a presentation on commas.
 
7:49 PM
@FredOverflow what's amusing about that..?
 
@FredOverflow Do you have a good c++-faq about iterators?
 
They also allow you to separate words, sentences, and items in enumerations, lists and other things.
 
Semicolons also allow you to highlight beautiful sections of your code without using a comment:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; s.erase(std::remove_if(s.begin(), s.end(), isspace), s.end()) ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
That’s awesome for when you write C++-NASM polyglots!
 
@FredOverflow, You're really proud of that code conversion, aren't you.
 
7:50 PM
I don't know about you, but I find the erase-remove-idiom most beautiful.
 
@EtiennedeMartel hey, I know you have that idea of writing a C++ tutorial and shit. What about starting small and writing a proper style guide, for guerilla against Google's?
 
@chris Still had it open in my editor, and I was too lazy to find a different example :)
 
@FredOverflow isspace sucks. ogonek::ucd::is_white_space FTW.
 
; puts("Hello"); /*
push hello
call _puts
; */
 
Ah, that's valid ASM and C++, nicely done! What is that called again, Polyglot or something?
 
7:51 PM
And C! And Objective-C, and Objective-C++, and probably also D.
1 min ago, by Radek Slupik
That’s awesome for when you write C++-NASM polyglots!
 
I should pay more attention :-(
 
C!? Don't tell me they brought out another one.
 
@R.MartinhoFernandes Do it. I mean Etienne.
 
@keith.layne Ah.
 
or whatever.
 
7:52 PM
I already have too much on my hands.
 
@ManofOneWay Not off the top of my head, no. What do you want to know about iterators?
 
Iterators suck.
I sound like the cat.
 
For an introduction to iterators, I suggest the holy bible:
 
You sound like somebody who hates vacuum cleaners.
 
@FredOverflow Everything! Basically what kind of iterators there are, the difference between them etc.. Maybe how to implement iterators for a custom class
 
7:54 PM
@ManofOneWay The answer to the last one? With Boost.Iterator and blood from virgins collected under the full moon.
 
@ManofOneWay Writing them yourself? In that case, I recommend this classic:
Matt Austern is one of those C++ guys who really know what they're talking about.
 
Not writing custom iterators, using existing iterators for a custom class
 
I should go to the barber’s; my hair is too long for GCC.
 
@ManofOneWay Just return them?
 
@ManofOneWay What do you mean? Example?
 
7:56 PM
For example, if I create my own vector class I want to be able to operate on the elements using iterators.
So that I can use all the available algorithms
 
Create from scratch? Or wrapping std::vector?
 
If you create your own vector class, you need to write your own iterator class. Or you cheat and just return naked pointers, since vectors are contiguous :)
 
Once I gave GCC something like std::cout << 1000L; and it printed something like 1.8945e-396. That was a confusing one to fix.
 
I've seen that...what was the cause?
 
Creating a vector from scratch. Isn't is possible to use the existing iterators then? Or inherit from them or something?
 
7:59 PM
@R.MartinhoFernandes I don't really like pushing conventions down peoples throats.
 
@ManofOneWay You can inherit from a standard library class template that provides some typedefs for you, but you must implement the logic yourself.
 
7
A: What does delete command really do for memory, for pointers in C++?

Christian StieberThink of memory as a big warehouse with lots of boxes to put things into. When you call "new", the warehouse staff finds an unused box large enough for your needs, records that box as being owned by you (so it's not given to someone else), and gives you the number of that box so you can put your ...

Best analogy of dynamic allocation I've ever read.
 
@keith.layne, Something about it using 96 or 108 bits for a long double, but using MSVC runtime, which uses 64.
 
0
Q: bundle of invalid errors: C2059, C2143, C2181, C2660

forest.petersonThis bundle of errors is caused by one function, and none of these errors are valid error C2059: syntax error : '=' error C2143: syntax error : missing ';' before '{' error C2181: illegal else without matching if error C2660: 'Lexicon::convertOntology' : function does not take 0 arguments st...

Weird use of the word "bundle".
 
I was about to post that when I found the solution (I think in another SO question).
 
8:01 PM
@EtiennedeMartel Stay away from the spaces and braces crap, and focus on the crap things they have like "don't use exceptions and shit".
 
long double except on MSVC is just the 80-bit FPU on x86.
 
Hmm, nevermind, that would basically be the same but with "do" instead of "don't".
 
@EtiennedeMartel What is an "invalid error"? Are there also "valid errors"? :)
 
@EtiennedeMartel dat coding style.
return convertOntology(in.substr(1), d, out+=vectorSearch(list, temp, 0, d, r), "");
                                        // ^^ doesn't even make sense
out is a value.
 
typedef std::string& string;
 
8:04 PM
lol
 
If you do that, you’re an idiot.
You should obviously be using using (pun intended) instead of typedef.
 
~in a super interesting meeting about deploying mainframe data which I don't understand and don't have to~
well, at least I don't have to work
 
fast forward two weeks "WTF? I need to know about deploying mainframe data?"
 
8:08 PM
@R.MartinhoFernandes bwahahahahahaha, nooo
I'm just a code monkey (:
 
Oh cool new version of OS X.
 
Posted in answer: Answer to come
 
That's downvote worthy.
 
link?
 
@n2liquid In my experience, it pays (literally) to understand more than you're expected to
 
8:14 PM
@R.MartinhoFernandes lol, nice pricing :)
 
@Collin of course, but I have no intent of "growing" inside this company
 
@R.MartinhoFernandes Do they also offer to pay in YEN? :)
 
maybe you can purchase in $, then get a refund in €? :)
3
 
LOL
 
Dammit, C++ Y U NO POLYMORPHIC LAMBDAS.
 
Ell
8:32 PM
polymorphic lambdas? o.O
 
Xeo
Hm, how do you declare a reference to a const array?
@R.MartinhoFernandes Make a proposal! :)
 
alias<int const[N]>&
 
@Xeo you mean an array of const data..? what would be a const array?
 
It's the same.
 
Xeo
hmpf
Didn't expect T const (&arr)[N] to bind to a temporary array
 
8:36 PM
Why are you caring about temporary arrays?
 
Xeo
I'm sure it makes sense in some twisted way
1
Q: C++ Function call with a 'new' array argument

Bob SmithI want to call a function which requires an array of integers. How could I do this without creating a new array of integers every time I want to call the function? This is what I want to do: someFunction(new int[]{obj[0].getInt(), obj[1].getInt()}); instead of doing this: int intArray[2] = {...

+ alias<int[]> :D
 
@R.MartinhoFernandes yay, I just used liveworkspace.org/code/8a874ef32ebcfa8eebfa271127f4d202 to 'enliven' a Spirit answer:
 
@R.MartinhoFernandes doesn't std::function take care of that?
 
0
A: How to pass the iterator to a function in spirit qi

seheI'm not completely sure why you think you 'need' what you describe. I'm afraid the solution to your actual task might be very simple: start_p = qi::double_ % ',' > qi::eoi; However, since the actual question is quite interesting, and the use of position interators in combination with istrea...

 
@MooingDuck Erm, no.
 
8:37 PM
@Xeo Link to flaming zone
 
I want to take a function object that doesn't know what type are the arguments I'll pass to it.
It only knows the concepts.
 
@R.MartinhoFernandes oh
 
Basically, a function object with templated operator().
 
Xeo
@R.MartinhoFernandes Maybe the Boost.Phoenix placeholders are an option?
 
@R.MartinhoFernandes you have to put the lambda in a template function right?
 
8:39 PM
Anyone every tried a LAN party over VPN?
 
@KianMayne yes, two dorms on my college campus did that.
 
Xeo
@R.MartinhoFernandes if worst comes to worst, write a local one
 
@Xeo For me? No. It's the caller that gets fucked.
 
@Xeo I guess. See my demo free function 'do stuff' in that linked example, actually: liveworkspace.org/code/8a874ef32ebcfa8eebfa271127f4d202 /cc @R.MartinhoFernandes
 
@KianMayne Does stuff like Hamachi count as a VPN?
 
8:39 PM
@MooingDuck Ahh right, just wondered whether it was useful
 
@KianMayne Aren't LAN parties all about communication, drinking a beer together and stuff? How would that work over VPN?
 
@Mysticial I don't no let me look up Hamachi
 
LAN != WAN
 
@FredOverflow two LANs
 
@Mysticial yes
 
8:40 PM
@FredOverflow voicechat servers. No, it's not the same, but when you can't physically be in the same place it's a decent alternative
 
@Mysticial Hamachi is a VPN program
 
Brb
 
@KianMayne then yes, I do LAN parties over VPN all the time.
 
Xeo
@sehe BOOST_PHOENIX_ADAPT_FUNCTION(double, doStuff, doStuff_, 2) does what, exactly?
 
I guess the only thing I can do to alleviate this for the caller is to provide some type erased things they can use as parameter types of a lambda.
 
8:41 PM
@R.MartinhoFernandes Primarily because they didn't play well with Concepts :)
 
Xeo
@FredOverflow but now they do
 
@Xeo It creates a phoenix lazy function with two generic placeholders (that will only get deduced at the time they are used in a phoenix lambda expression)
 
@R.MartinhoFernandes can't use a functionoid rather than a lambda?
 
Xeo
or would
 
@MooingDuck Yes, they can. But that's annoying.
 
Xeo
8:42 PM
@R.MartinhoFernandes So what exactly is the lambda expected to do?
 
Well, I think I can provide a couple of defaults for this callback.
 
Anyone got a dupe they know of for a container of different types of structs?
 
@SamDeHaan I don't know, sitting alone in a room int front of a PC and drinking beer just doesn't cut it for me.
@chris You want Boost.Variant or Boost.Any
 
@FredOverflow that's an answer, not a dupe
 
@FredOverflow, I know, I was just trying to remember one of the questions.
 
8:43 PM
@Xeo I'm still thinking about that :) Take an invalid sequence of code units and an enum value describing the reason it was rejected, then #1 replacing it with a valid sequence; #2 throwing something; or #3 ignoring it altogether.
 
Oops, I just realized the question is in C. I'm pretty sure I've seen some of those too, though lol
 
@chris In that case, I recommend the Coost libraries (not invented yet, but sounds like a good idea).
 
Command & Conquer?
 
8:46 PM
Red Alert
Far superior
 
I don't drink coffee, and I don't have a cat :(
 
Xeo
I want a cat :(
 
@FredOverflow Hmm. Me neither.
 
Nobody likes RA?
Sad :(
 
8:50 PM
hey all
hello batman
:D
i've just download batman of gameloft to my mobile
 
@user1459961 Hi.
 
the full stop makes it look quite definitive
 
@Fred have you seen this paper from Bjarne? stroustrup.com/ETAPS-corrected-draft.pdf I posted it earlier, but I don't think you were around. I thought you might like it.
 
@IAmBatman You will find lots of love for the successor to RA in the Lounge: RA II.
 
Guess who I'm watching right now.
 
8:54 PM
@R.MartinhoFernandes Looks very interesting, thank you. What is ETAPS? And can you post a link to your original post?
 
It's so nice to run in the evening
 
@FredOverflow European Joint Conferences on Theory and Practice of Software, I think.
 
Hey @FredOverflow. Why do you always make the best jokes?
 
7 hours ago, by R. Martinho Fernandes
http://www.stroustrup.com/ETAPS-corrected-draft.pdf
 
@R.MartinhoFernandes Why can't I star that unless I hit "load older messages" a billion times? Stupid technology.
 
8:57 PM
@FredOverflow Star this one?
 
@FredOverflow click the link, click the arrow next to it, "star as interesting"?
 
Do you guys exercise?
 
Can you make the link nicer? "Bjarne Stroustrup - Foundations of C++" or something?
 
Exercise? Phlehhh
 
@FredOverflow Done.
 
8:58 PM
Star teh shit out of it
 
I haven't read it all yet, but it's quite nice.
 
@MooingDuck Cool, I didn't know that! I always use the star option to the right of the message.
 
+1 for starwhoring for someone else.
 
@ManofOneWay I do pull ups twice a week, and I program in C++ every day.
 
@FredOverflow yeah, it was a long time before someone told me too
 
8:59 PM
@ManofOneWay I walk around mostly.
 

« first day (648 days earlier)      last day (4316 days later) »