« first day (3157 days earlier)      last day (2016 days later) » 

09:04
@traducerad a c style api is one that is compatible with the c language. For example, win32. Crucially such an api prefers handles to objects, and and sets and gets state rather than returning classes. You will find that a c++ api has a lot of wacky problems like changing structure sizes across versioning (opaque pointer) or resources owned by different c++ runtime. Also coding style. Also languages like matlab, LabVIEW, python can auto import these libraries.
 
2 hours later…
10:49
@Borgleader Btw, that's not a dumb question.
 
2 hours later…
13:16
Anyone know how to cast this in c++ style ?
const A* pa = new A();
(int*)(pa)
 
1 hour later…
14:16
@Mysticial @ScarletAmaranth @Xeo Just started watching Carole & Tuesday. It's really something special.
14:43
^ lol, this painting
14:56
Nice reference.
15:13
https://stackoverflow.com/questions/56506611/how-to-find-max-by-comparing-one-value-of-vector-x-against-vector-y-and-if-max-e

Can someone please checkout this post and help me out? :-)
15:32
auto g = [=](float a) { return a * c; };
If I have to remove the keyword auto what can I put instead of it ?
Is it possible even ?
float c = 3.f;
@Shago Why not use the type of a or c, if a is an int and c is a double, use the return type of c, so there won't be any loss of data.
it gives me an error that no suitable conversion between labmda []float(float a)->float to double exists
same with if i put float as the return type
 
1 hour later…
16:51
@Shago The type of g is "unspeakable", but you could write std::function<float(float)> g if you're willing to pay the performance cost.
If c is a global (that is, the lambda does not capture any state), you can write float (*g)(float) = ... without the wrapper.
Why can I not initialize a static array of strings directly in the class? I thought this is possible with newer C++ but clang gives me:
"static data member of type 'const std::__1::string [9]' must be initialized out of line"
hi @fredoverflow
So much friction there is.
@Nils Are you using clang -std=c++17 or what do your command line options look like?
I set set(CMAKE_CXX_STANDARD 17) in the top level CMakeLists.txt file, so I assume so.
Let me check the exact commands...
It uses -std=gnu++1z aaargh
Huh? To counter the earlier comments, GCC rejects in-class initialisation with "error: ISO C++ forbids in-class initialization of non-const static member", and clang does with "error: non-const static data member must be initialized out of line". Both regardless of -std=* options. Which standard supposedly allows this? — user743382 Feb 7 '15 at 12:29
Apparently it's not possible for string arrays?
CMake is also super annoying, I set:
set(CMAKE_CXX_STANDARD 17)
set(CXX_STANDARD_REQUIRED ON)
set(CXX_EXTENSIONS OFF)
Guess what is added to the compiler? std=gnu++1z!
17:16
can someone explain function templates to me, i have read about them, but I just dont understand them....
You can use template parameters on functions just as you do on classes.
it is like an universal datatype for functons?
or?
Like:
template<typename iter_t>
void myQuicksortImpl(iter_t begin, iter_t end) { .. }
Or see the possible implementation here: en.cppreference.com/w/cpp/algorithm/partition
 
2 hours later…
19:37
What do you understand by Template as an English word @CppPythonDude
 
4 hours later…
23:42
I finally saw a wild bear in Banff!!!
Also the mountain goat was against the traffic.

« first day (3157 days earlier)      last day (2016 days later) »