« first day (370 days earlier)      last day (2707 days later) » 

Ron
Ron
00:13
Can I get away without knowing all that voodoo about the perfect forwarding of rvalue and lvalue, universal references and similar?
I guess not :)
00:29
@Ron For the most part, but, as it usually is with C++, sooner or later you get near an abstraction leak, and all these rules fall down on you
I consider this stuff quite messy, but still, introduction of these features was a good idea because it brought incredible benefits
Ron
Ron
Yes, messy is the right word.
@milleniumbug As always, appreciate.
 
4 hours later…
04:27
Does anyone use netbeans for c++? I can't figure out how to make it show me compiler warnings (they show for a split second, but the terminal clears when the program runs)
04:56
woops never stupid mistake..
 
7 hours later…
12:26
does any1 here have any experience in using cLion with msvc environment ?
trying to set it up to compile...
 
2 hours later…
14:19
quick question : if i have "float x [];" inside a class of a header file how can i do something like this in the Ctor of the cpp file : x [] = {1, 2, 3}; ?
nwp
nwp
@Shago wrong room go here
66
A: How do I use arrays in C++?

fredoverflowArray creation and initialization As with any other kind of C++ object, arrays can be stored either directly in named variables (then the size must be a compile-time constant; C++ does not support VLAs), or they can be stored anonymously on the heap and accessed indirectly via pointers (only the...

thank you
quick question : if i have "float x [];" inside a class of a header file how can i do something like this in the Ctor of the cpp file : x [] = {1, 2, 3}; ?
4 messages moved from Lounge<C++>
nwp
nwp
@Shago You can't. float x []; is not a legal member of a class. You are probably using a gcc extension to make it compile, but it still doesn't work the way you want it to.
There are some C-tricks with over-allocating, but it is difficult and error-prone to pull off. Use a std::vector<float> instead.
14:25
@nwp He probably actually has a float x[3]; I guess...
no i want in the class header float x[];
So you don't know how many floats you need?
Then use std::vector<float> x; instead.
ok, thank you
 
1 hour later…
15:28
hi
15:42
any video processing fans here?
can I determinate an object area in a video using the camera position?
 
4 hours later…
Ron
Ron
19:55
Is there some built in mechanism in g++ that prevents the trivial code in this question to go out of bounds? VC++ result goes out of bounds and prints garbage.
When compiled on Linux it doesn't. Why is that?
nwp
nwp
@Ron there is Asan and UBsan which at least partially work on gcc too and should catch that
Ron
Ron
@nwp Ah so... Awesome. Thanks for the links and info.
nwp
nwp
@Ron Undefined behavior is undefined. There happened to be a 0 at the end of that array. Some debuggers initialize the stack with all 0s, which is not actually helpful.
Ron
Ron
I see.
Apparently when compiled on my local machine under Linux it also exhibits UB. I was under the impression the Coliru and local results should be identical.
Wrong assumption. Thanks for the clarification.
nwp
nwp
Doing exactly what you want is one of the ways UB can manifest. Also to catastrophically fail when someone else is looking.

« first day (370 days earlier)      last day (2707 days later) »