Comment by HolyBlackCat on Is this a valid usage of `std::atomic`
The shorter notation you use defaults to memory_order::seq_cst, not relaxed.
View ArticleComment by HolyBlackCat on gdb version not the same with gcc and g++
"All three those should be same version." No they shouldn't, they are numbered independently.
View ArticleComment by HolyBlackCat on Losing precision when casting float to double,...
@Blabba I wonder if there's a setting for this. Normally you don't want to see all those digits, so I'm not surprised it's rounded by default.
View ArticleAnswer by HolyBlackCat for How do I permanently change the MSYS2 PATH?
You shouldn't manually add /??/bin to the PATH in the MSYS2 terminal.It happens automatically (along with other changes to environment variables) when you open the terminal for the environment you want...
View ArticleAnswer by HolyBlackCat for How do I write a Makefile target with a repeated...
You can hack something together with $(eval ):# Create a list of inputs.override inputs := $(wildcard inputs/*.py)# A list of output files which we fill below.override all_outputs :=# Function to...
View ArticleComment by HolyBlackCat on Trouble using a header-only library in Visual...
I suggest adding information where to find the header-only vs the normal version.
View ArticleComment by HolyBlackCat on Why are exceptions so rarely used in C++
"With C++98, there had been undefined behaviour when a function just propagated an exception was without a throw(something) annotation" Huh! Do you have a source for this?
View ArticleComment by HolyBlackCat on How to send the caller object as parameter to the...
"If i use *this, i get the error i mentioned" If you use *this, it fixes this error and simply exposes the next error. Remove (test) from test.onEvent(onUpdateEvent(test)); and make the parameters of...
View ArticleComment by HolyBlackCat on is it safe to have C++ asserts in production code?
I'd argue that crashing in release is fine. (Perhaps not by the means of assert.)
View ArticleComment by HolyBlackCat on Linking C++ VisualStudio libraries in a MingW project
Why do you need VS in the first place? You can build oneTBB directly with MinGW (MSYS2 does that).
View ArticleComment by HolyBlackCat on What is the intended way of passing c++ Views and...
@Dialecticus What does it improve?
View ArticleComment by HolyBlackCat on boost library in C++ Builder 12.1 (Modern)
If you don't mind me asking, it's the first time I'm seeing somebody use this compiler. Why not something more mainstream? (GCC, MSVC, or the unmodified Clang) What's the difference compared to Clang...
View ArticleComment by HolyBlackCat on What is the intended way of passing c++ Views and...
The second overload should use a const or forwarding reference. And you can keep only the second overload and pass ranges::subrange when you want two raw iterators.
View ArticleComment by HolyBlackCat on Running shell snippet on windows via GNUmake
Where did you download Make? Is it make or mingw32-make?
View ArticleComment by HolyBlackCat on C++20 std::async with template lambda of zero...
Are you limited to C++20? Or just mention it because it adds the template lambdas?
View ArticleComment by HolyBlackCat on C++20 std::async with template lambda of zero...
I'd prefer std::bind_front. Plain std::bind among other things will happily accept excessive arguments and silently ignore them.
View ArticleComment by HolyBlackCat on What is the intended way of passing c++ Views and...
@lucidbrot If you use a span, yes.
View ArticleComment by HolyBlackCat on Does try_emplace guarantee to not move the key...
I think you're overthinking this. Cppreference also says: "If a key equivalent to k already exists in the container, does nothing.", and the standard says something similar:...
View ArticleAnswer by HolyBlackCat for Temporary object can bind to non-const reference?
Objects exist in memory at runtime. They can be temporary (if constructed in a certain manner) or not.Expressions are parts of the source code referring to objects, they only exist at compile-time....
View ArticleAnswer by HolyBlackCat for C++20 std::async with template lambda of zero...
Just for completeness, if upgrading to C++23 is an option and the lambda is non-capturing, you can make it static:#include <future>#include <array>int main(){ auto func = []<int n>()...
View Article