« first day (600 days earlier)      last day (4331 days later) » 

5:00 PM
Shop was closed. :<
 
It's a holiday here.
 
Yeah.
Stupid holidays.
 
@RMartinhoFernandes fixed: ideone.com/AvUwU
 
@JohannesSchaublitb " a little" :)
 
Thankfully pizza people are working.
So I won't starve.
All hail pizza people.
 
5:01 PM
@JohannesSchaublitb Holy blackberries, you're evil.
 
the new face paw-palm:
 
@JohannesSchaublitb slurp? What? Why not just an overload?
 
@TonyTheLion It's facepaw, silly.
 
and how does that work?
 
5:02 PM
@RMartinhoFernandes nice one :P
 
Pacefalm.
2
 
try slurp, throw slurp, catch slurp
 
Ell
a paw palm would be a clap, really
 
How much rep does it take to edit and not be peer reviewed?
 
5:03 PM
@MooingDuck you can make an SO question about it
 
@Ell A hi-five between a cat and a human.
 
Ell
Yeah thats right :P
 
@MooingDuck It calls print(args...) once per trailing arg.
 
Ell
is there a literal for unsigned?
 
The throw makes sure it stops after the first one.
@Ell Trailing u.
 
5:04 PM
but it doesn't fail for the last one!
 
Ell
@RMartinhoFernandes thank you :)
 
@JohannesSchaublitb There are no trailing arguments in the last one.
 
oh i misread
 
@MooingDuck It relies on initializer-lists being guaranteed to compute each element in order.
 
Programming motherfuckers do you speak it?!
 
5:09 PM
@Nils while (!sleep) sheep++
 
;
 
@RMartinhoFernandes actually i'm not sure whether that code is valid
 
Ell
virtualbox, y u no like opengl & fullscreen!
 
@Maxpm thanks for that :p
@Ell ?
 
@Nils I don't know of any language that is programming, so it's kinda hard to speak it.
 
5:11 PM
@RMartinhoFernandesthe function call is ill-formed
 
@melak47 y u expensive increment! ++sheep!
 
GCC just gives no error because the pack expansion "erases" the code
 
come to think of it...with virtualbox on my third screen, which was hooked up to the old and defective GT 220..I had a lot of driver crashes. In general with openGL stuff. glad I got rid of it
 
Ell
@melak47 i don't get crashes or anything - its just sometimes works, sometimes is black
 
Zed Shaw is doing a Programming motherf.. book. Not that I'm a big Zed Shaw fanboy, but I like the idea of having it on my desk instead of clean code or something :)
 
5:12 PM
@JohannesSchaublitb Oh. Good point.
 
@melak47 ideone.com/awrmK trinary x<y<z
 
@RadekdaknokSlupik --((++sheep)++) ?
 
@melak47 UB, AFAIK.
 
that's not valid code
 
@RadekdaknokSlupik actually, that doesn't even compile :p
 
5:13 PM
Why not?
 
(++(++sheep))-- will be valid
 
hi every1
 
Good day! But is the 1 really necessary?
 
Hi lazy typist.
 
@JohannesSchaublitb valid UB? :)
 
5:14 PM
valid nonUB
 
aw, that's just boring then
 
@RadekdaknokSlupik can't -- on a rvalue, and the trailing ++ creates an rvalue.
@PeteHerbertPenito we speak English here (and C++)
 
I have a quick question, I have allocated an array, called "ret", how can i check to see if "ret[i]" is not pointing to a bad address?
 
Ruby hasn't even got ++. xD
@MooingDuck Overload operator--(T&&) or operator(T)?
 
@PeteHerbertPenito how did you allocate it?
 
5:16 PM
@PeteHerbertPenito you could zero all the pointers in the beginning
 
@RadekdaknokSlupik you'd want "operator--(int)&&" I think
 
You can't check if any pointer points to a bad address.
 
ty mooing, i think you have given me enough info :) I'll just handle it when I do set the value of ret[i],
 
@MooingDuck Nobody ever said that sheep was an int.
 
Which is not problem, because you are not making bad pointers in the first place, right?
 
5:17 PM
ty guys <- lazy typist
 
@Pete Why?
 
@RadekdaknokSlupik The two versions of operator-- take either () or (int) regardless of the class that they are part of. (The value is always 0)
 
user784668
@RMartinhoFernandes In theory, one can always set a signal handler, access the pointer and check if the signal was raised. Or something like that.
 
@PeteHerbertPenito memset(ret, 0, <insert size here>);
 
iv nevr understud ppl who type like this
 
user784668
5:18 PM
@melak47 What's wrong with std::fill_n?
 
@PeteHerbertPenito std::vector<std::unique_ptr<T>>
@melak47 no
 
@Fanael you tell me
 
33
A: Testing pointers for validity (C/C++)

Johannes Schaub - litbWhy do you keep voting down valid, answers to this question?? Anyway Update for clarification: The problem is not with stale/freed/uninitialized pointers; instead, I'm implementing an API that takes pointers from the caller (like a pointer to a string, a file handle, etc.). The caller can se...

 
@MooingDuck Oh yeah I know.
Then you'd have operator--(T&&, int)
 
@MooingDuck no?
 
5:19 PM
@melak47 nothing is wrong with it, and theres no reason to prefer memset
 
guess I should go to the C room :(
 
@RadekdaknokSlupik no, that's not valid C++ either. Btoh instances of operator-- are unary functions, they do not take a T of any sort, in any circumstance. Period.
 
@MooingDuck I'm not overloading them as member functions, silly.
 
@melak47 you can be here, just don't tell C++ coders to do the C thing.
 
class Sheep {}; Sheep operator--(Sheep, int);
 
user784668
5:21 PM
@MooingDuck y u hate c its superior
 
@Fanael he doesn't he hangs out in the C room quite a bit, too, I think :p
 
24 hours ago, by FredOverflow
Every time I program in C, I feel like I've traveled back in time. You cannot even return a string from a function without getting a headache.
 
@Fanael That only works for some pointers.
 
@RadekdaknokSlupik ....oh right. I never do that.
 
@Drise timetravel is awesome
 
user784668
5:22 PM
@Drise Every time I program in C… but I don't.
 
@Fanael Y U SAY C IS SUPERIOR?
 
@melak47 C++ is surperior in every way, I hang out in the C room to help people, and to keep them from irritating the C++ room with their silly language.
 
so you do hate C? :(
 
user784668
@Drise cus irony
 
@MooingDuck I did it exactly once: to implement global operators for enums.
 
5:23 PM
@melak47 yes. C++ FOREVER!
 
user784668
@MooingDuck C++ is inferior in sucking.
 
aw.
 
@Fanael Zing.
 
I dislike people who mix c and c++. And then treat it like "its the way it was meant to be".
 
lol
 
5:24 PM
@Drise that's even worse >.<
Gah SO! Why do I have to refresh to see what people are saying?
 
I dislike brogrammers who write ugly C with classes code and think they do C++
 
I dislike everything.
There, I win.
 
@Nils half the code at my work is like that :/ I have to keep track of which classes will be memcpy'd somewhere :(
 
No, I do not want to use your silly printf() and sscanf() statements in my c++ code, thank you.
 
@Drise Oh, I thought Drise was shorthand for Derise :)
 
user784668
5:25 PM
printf > operator<< for internationalization.
 
That's why we have std::cout and std::stringstream.
 
@MooingDuck Can you at least sprinkle static_assert(std::is_trivially_copyable<T>::value, ""); things around?
 
@sehe No, Its actually pronounced "dries".
 
user784668
@MooingDuck Boost? I don't have infinite amount of time for waiting for my code to compile.
 
5:27 PM
printf sucks.
 
I dont know how to spell.
 
2 mins ago, by Fanael
printf > operator<< for internationalization.
Even you can't disagree with that.
 
Formatting, yes. Printf, no.
 
@Nils "brogrammers" :)
 
Reads question title "Same piece of code, different behavior on Windows and Linux". Guesses answer is "UB". Reads question. It's UB.
 
5:29 PM
@RMartinhoFernandes There's been a few times where I see a question, comment "Such and such is UB. Now I'll read the question and give you a detailed answer when I'm done."
 
so...is int *array[123] = {0}; acceptable or an atrocity in c++land?
 
user784668
@melak47 std::array<int*, 123>
 
An array of pointers? Atrocity.
2
 
user784668
@melak47 Non-owning raw pointers – okay. Owning raw pointers – die.
 
Can someone please answer me the 2) and 3) Questions.
http://stackoverflow.com/questions/10934226/c-class-friend-function-inside-a-namespace
 
5:31 PM
std really needs a deep_copy_ptr and non_owning_pointer, and then there will be no more uses for (non-library)T*
 
@MooingDuck I think Qt implements those
 
@Drise good
 
@MooingDuck non_owning_pointer is T*. What's the gain?
 
Ell
see thats why we need an std::non_owning_ptr
 
user784668
@RMartinhoFernandes Moar typing.
 
What for? It's just T*.
 
Ell
@RMartinhoFernandes semantics! ...programmer intention. self documenting code
 
@Ell T* already has that semantics.
 
Ell
@RMartinhoFernandes not always?
 
T* is already documenting no-ownership.
 
user784668
5:33 PM
@Ell std::non_owning_ptr<int> ptr(new int(5)); // what now?
 
@Ell Only when misused.
There's nothing preventing misuse of your hypothetical non_owning_ptr.
 
Ell
what about when interfacing with c libraries, etc.?
 
user784668
@Ell T*
 
@Ell What about it?
 
My niece counted her ten sprinkles as "one, two, three, four, one, six, seven, sixty-one, nine, ten!"
 
5:34 PM
@MooingDuck She at least arrived at ten. We should modify operator++ to work like that.
 
auto p = make_unique<T>();
some_silly_c_function(p.get());
 
anyone ?
 
We should also have a pwning_ptr<T> that can do everything.
 
Ell
if T* already had those semantics, you wouldn't have said "Array of pointers? Atrocity."
 
@RMartinhoFernandes right, it would merely declare intent. it could be a typedef for all I care
@Ell they all have a .get() function obviously
 
5:35 PM
template <typename T>
using non_owning_ptr = T*;
Here you go.
 
Ell
agh sorry have to dash guys, ta ta!
 
@MooingDuck No need to be in the standard then. Just template <typename T> using non_owning_ptr = T*;. It's still worthless though. Just have T* declare intent as well.
 
@AlexDan your question looks answered to me
 
@CatPlusPlus basically, yes. Though maybe it should be a class, merely for a .get() function to keep it like the others :/
 
5:35 PM
template <typename T>
using stupid_ptr = T*;
 
user784668
@RMartinhoFernandes Just don't let C-retards touch your code.
 
If T* declares some other intent in your code, you're doing it wrong.
@Ell I was making assumptions about it. And being over-general.
@MooingDuck Having a dumb_ptr thing doesn't even prevent the idiots from writing T*.
 
@RMartinhoFernandes yes, but other idiots not might understand that intent. I could comment my code, but a typedef seems better.
 
user784668
1 min ago, by Fanael
@RMartinhoFernandes Just don't let C-retards touch your code.
 
Idiots gonna idiot.
 
5:38 PM
@Drise What's wrong with good old printf? :)
 
Uncontrolled format string is a type of software vulnerability, discovered around 1999, that can be used in security exploits. Previously thought harmless, format string exploits can be used to crash a program or to execute harmful code. The problem stems from the use of unchecked user input as the format string parameter in certain C functions that perform formatting, such as printf(). A malicious user may use the %s and %x format tokens, among others, to print data from the stack or possibly other locations in memory. One may also write arbitrary data to arbitrary locations using the %n f...
 
mawnin
 
@FredOverflow Second reason: It's C.
 
If you don't make it a typedef, the idiots will complain your dumb_ptr is dumb because: 1) it's not straightforward to use, you need to call get or something and shit; 2) it's bloated; 3) it has overhead.
 
user784668
The GNU Compiler Collection (GCC) is a compiler system produced by the GNU Project supporting various programming languages. GCC is a key component of the GNU toolchain. As well as being the official compiler of the unfinished GNU operating system, GCC has been adopted as the standard compiler by most other modern Unix-like computer operating systems, including Linux, and the BSD family. A port to RISC OS has also been developed extensively in recent years. There is also an old (3.0) port of GCC to Plan9, running under its ANSI/POSIX Environment (APE). GCC is also available for the widely...
 
5:39 PM
@MooingDuck after reading the answer, I got confused because I know that's it's not necessary to declare the function friend before the class. but in the particular case it doesn't work unless I add the declaration of the freind function before the class. please read my 2nd and 3rd questions are the ones that are unanswered yet. thanks
 
@RMartinhoFernandes The idiot's idiocy is their own problem.
 
printf is not extensible and not type safe and sucks.
 
Whether you make it a typedef or not, they will complain that it is dumb because it's too much to type.
 
@Drise printf can be found in many languages.
 
@DeadMG That's the point I'm trying to make, since the entire point of the dumb_ptr exercise was to fight idiots.
Without idiots involved, T* works fine.
 
5:40 PM
ah, that thing again
 
@CatPlusPlus You can make a type safe version in C++11 now.
 
@FredOverflow Its irksome when we have things like std::cout. It make for cluttered combinations of C and C++
 
I also think that dumb_ptr is, as aptly titled, dumb.
 
@RMartinhoFernandes well, if you call it dumb_ptr, you shouldn't get upset when other people call it dumb, too :)
 
@FredOverflow Then it's no longer "good old printf".
 
5:41 PM
With idiots involved well, there are idiots involved.
 
@Drise std::cout is irksome when we have things like std::cout :)
 
There are already formatting solutions that are better, why reinvent the wheel.
 
Because reinventing the wheel can be fun :)
 
Because I need a new wheel to fit Wide :P
 
@FredOverflow Only halfway, because you can't strings in TMP without hassles.
 
5:42 PM
You know why "x" is the unknown? Because you can't say "sh"(it) in spanish.
 
@RMartinhoFernandes you can't what?
 
Streengs.
 
@RMartinhoFernandes WTF does "you can't strings" mean?
 
5:43 PM
@FredOverflow You can't use them.
 
You accidentally a string.
 
@CatPlusPlus I purposedly a string.
 
I intentionally accidentally a string.
 
That's what she said.
 
safe_printf("%0 %1", x); Where's your type-safety bitch?
 
5:44 PM
array of pointers is like int a[][]
 
@RMartinhoFernandes at runtime
 
That's why I said only halfway.
 
ah okay
 
@RMartinhoFernandes runtime type safety
still 100%
 
In TH you can have full compile-time safe printf.
 
5:45 PM
but te string must be known tat compile time
 
Well, with i18n you can't.
 
in c++ wit compile time strings tat is possible too
 
Let's all convert to D then and write compile time type safe printf templates.
 
:/
 
5:45 PM
@AlexDan The first answer clearly explains why (2), because otherwise C++ assumes it's in the same scope as the class. I don't know the answer for (3).
 
Let's all convert to Haskell.
 
@JohannesSchaublitb your <kbd>h</kbd> key has a fail.
 
yes it's broken
sit
 
@MooingDuck : thanks
 
@JohannesSchaublitb /cc @DeadMG
Right?
 
5:46 PM
what's that
 
@RMartinhoFernandes huh?
 
Ok, I fail at jokes.
 
Oh robot. All jokes.
 
@RMartinhoFernandes I got it
 
5:48 PM
i didnt get it
 
You told DeadMG to sit, obviously.
 
Robot's jokes algorithm needs a little bit of tuning.
 
5:49 PM
@RMartinhoFernandes Let's not lie to ourselves robot, the humor was already dead.
 
tears of failness
 
I starred your trope, if that makes you feel any better.
 
I'm already sitting down anyway
 
@DeadMG Good boy!
 
5:50 PM
why would i tell him to sit
 
wouldnt it be more interesting to see him shit
 
@JohannesSchaublitb dude, you're a fuckin' pervert
3
 
I'm going to star that for its apparent awesomeness
 
5:52 PM
lol
 
room topic changed to Lounge<C++>: Awesomeness inside. [c++] [c++11] [c++-faq]
 
Now we forever will be reminded that @JohannesSchaublitb is a fuckin' pervert
 
@Drise And for those of us who can remember context, that he doesn't understand how to train dogs.
 
Easy: if they disobey kill them. Let natural selection handle the rest.
 
Speaking of awesomeness, did you see the second version of my graph?
 
5:54 PM
@RMartinhoFernandes You need to yell "exterminate" more.
 
NO
 
@CatPlusPlus Yes.
 
@CatPlusPlus I just saw it. I'm dissipointed that C++ is still <0.
 
I'm puzzled by how it has DongML in it.
 
Do not violate this chat with that foulness.
 
5:55 PM
@SamDeHaan STOP! it's no "training" to tell them to "sit"
 
@CatPlusPlus what graph
 
that's just stupid playing-around with the dogs
 
@RMartinhoFernandes To emphasise how more awesome it is than those things left of it.
 
WTF is this room's dwellers obsession with DongML?
 
@RMartinhoFernandes not it
 
5:55 PM
bitch slaps @melak47 You fool!
 
but I wanna see it :p
 
eh
 
What's that thing to the right of LISP, btw?
 
C# goes behind C++, IMO
 
5:56 PM
curses. I shouldn't have to reboot my computer every time I tell Visual Studio to "build" instead of "build just this project". This is friggen ridiculous.
 
@DeadMG What.
 
@RMartinhoFernandes Ruby.
 
Ruby.
 
@DeadMG Gosh, his mspaintwriting sucks.
 
@EtiennedeMartel System.Object, enforced-GC, "Everything must be a class", weak-ass generics? It's < C++ in the Awesomeness Scale
 
5:57 PM
Hey, not MS Paint.
Paint.NET.
 
@RMartinhoFernandes That's art.
 
@RMartinhoFernandes Who's doesn't?
 
@MooingDuck lol, wha?
 
@Drise Mine.
 
@RMartinhoFernandes Prove it?
 
5:58 PM
@Drise I got this, give me a sec
 
@CatPlusPlus whichever paint it is, your skills in it are awesome
 
I dare you to recreate his chart
 
205
A: Why does the use of `new` cause memory leaks in C++?

R. Martinho FernandesWhat is happening When you write T t; you're creating an object of type T with automatic storage duration. It will get cleaned up automatically when it goes out of scope. When you write new T() you're creating an object of type T with dynamic storage duration. It won't get cleaned up automatica...

 
Look at that "pop!".
It's awesome.
 
@DeadMG I don't see those as actual weaknesses.
 
5:59 PM
@Drise his "pop" got him 205 upvotes
 
Fair, you win.
 
Pff, perfect rectangles.
Cheater.
 
Isn't that a meme around here now?
 
@DeadMG I can solve problems faster and with less code in C# than in C++. And that's why, IMO, C# > C++.
 

« first day (600 days earlier)      last day (4331 days later) »