do you ever find yourself debugging megabytes iostream overload errors, or megabytes of #spdlog template error that doesn't even contain a source location, and wish you had just used printf
do you ever find yourself debugging megabytes iostream overload errors, or megabytes of #spdlog template error that doesn't even contain a source location, and wish you had just used printf
Hey, do you know CMake? Can you spare a couple of minutes to do a code review? The Inkscape project sometimes struggles to find experts in some tools to do reviews and you could be a great help just looking over this include construct for unit tests (we're trying to do more unit testing)
Q: Is this ok to include a CMakeLists when putting together a list of cpp files for the unit test builder?
Hey, do you know CMake? Can you spare a couple of minutes to do a code review? The Inkscape project sometimes struggles to find experts in some tools to do reviews and you could be a great help just looking over this include construct for unit tests (we're trying to do more unit testing)
Q: Is this ok to include a CMakeLists when putting together a list of cpp files for the unit test builder?
So I need to represent, in C++, a structure like "a Value can be a bool, a string, a list of Values, or a map from string to Value"
This should be easy, something like:
class Value;
using String = std::string;
using List = std::vector;
using Map = std::unordered_map;
class Value {
// something tagged-union-like
};
However unordered_map can't have incomplete types as a parameter, even though it's totally possible T_T unordered_map is just pointers #cpp #programming
So I need to represent, in C++, a structure like "a Value can be a bool, a string, a list of Values, or a map from string to Value"
This should be easy, something like:
class Value;
using String = std::string;
using List = std::vector;
using Map = std::unordered_map;
class Value {
// something tagged-union-like
};
However unordered_map can't have incomplete types as a parameter, even though it's totally possible T_T unordered_map is just pointers #cpp #programming
Side note: I would LOVE to be able to use C++'s native tagged unions: std::variant. But defining something recursive with std::variant is impossible because you can't forward declare an alias. I want to do:
declare_alias Value;
using String = std::string;
using List = std::vector;
using Value = std::variant;
But there is no way to do that. You can only forward declare classes, structs and functions. So I'm stuck wrapping the variant in a class. #cplusplus#cpp
I'm stuck trying to decide whether to implement my own hash table, or use an additional and unnecessary level of pointers with unordered_map
C++17 gave us std::vector, std::list and std::forward_list of incomplete types (HOW DID IT TAKE THAT LONG), but from what I can tell, not even C++26 will have std::unordered_map of incomplete types :(
Of course in #Rust, vectors and hash maps and everything else just works with recursive types no problem
So I need to represent, in C++, a structure like "a Value can be a bool, a string, a list of Values, or a map from string to Value"
This should be easy, something like:
class Value;
using String = std::string;
using List = std::vector;
using Map = std::unordered_map;
class Value {
// something tagged-union-like
};
However unordered_map can't have incomplete types as a parameter, even though it's totally possible T_T unordered_map is just pointers #cpp #programming
C++ has the most bloated yet anemic standard library, the whole library is an over-engineered mess but lacks even the most basic functionality that's useful in the real world such as "format this timestamp as a ISO 8601 time" or "parse this ISO 8601 time to a timestamp", it's infuriating #cpp #cplusplus #programming
Why did IEEE specify sqrt(-0) to be -0?! That's … surprising when applied to the interpretation of -0 in the context of complex numbers:
sqrt(complex{-0,+0}) is complex{+0,+0}.
And also pow(-0, 0.5) is +0.
If anything sqrt(-0) should be NaN, but why -0?
I was able to use precompiled headers to significantly speed up recompilation! A full rebuild of all the gameplay code used to take 4.5 seconds, on my laptop. Now that I made it pre-compile the engine headers, it does it in 1.6 seconds.
I've tried precompiled headers before and struggled to get real speed-up, but I guess this is literally the perfect case for it; every gameplay source code is gonna include the exact same engine library header 😊 #cplusplus#cpp
Apparently there are no good #gcc tools to find unnecessary header includes in #CPP while using ninja/cmake (and NOTE not being the author of the build system)
...
A lot of you guys are #programmers what's the right tool here?
I don't need something that complains about every external include not found, just local symbols without having to recompile everything.
EDIT: Good Answers everyone!
C++ has the most bloated yet anemic standard library, the whole library is an over-engineered mess but lacks even the most basic functionality that's useful in the real world such as "format this timestamp as a ISO 8601 time" or "parse this ISO 8601 time to a timestamp", it's infuriating #cpp #cplusplus #programming
Why did IEEE specify sqrt(-0) to be -0?! That's … surprising when applied to the interpretation of -0 in the context of complex numbers:
sqrt(complex{-0,+0}) is complex{+0,+0}.
And also pow(-0, 0.5) is +0.
If anything sqrt(-0) should be NaN, but why -0?
I was able to use precompiled headers to significantly speed up recompilation! A full rebuild of all the gameplay code used to take 4.5 seconds, on my laptop. Now that I made it pre-compile the engine headers, it does it in 1.6 seconds.
I've tried precompiled headers before and struggled to get real speed-up, but I guess this is literally the perfect case for it; every gameplay source code is gonna include the exact same engine library header 😊 #cplusplus#cpp
Apparently there are no good #gcc tools to find unnecessary header includes in #CPP while using ninja/cmake (and NOTE not being the author of the build system)
...
A lot of you guys are #programmers what's the right tool here?
I don't need something that complains about every external include not found, just local symbols without having to recompile everything.
EDIT: Good Answers everyone!