Browse Source

ShaderTools: C++, you're stupid. Fuck you.

Like, it's INEVITABLE to have a 100-line std::lerp() implementation for
questionable reasons but such dead-simple thing as std::pair doing moves
instead of copies where expected that should have been done CORRECTLY
back in 2011 still isn't working reliably across implementations?!

I guess I'm doing my Containers::Pair soon as well, then.
pull/481/head
Vladimír Vondruš 6 years ago
parent
commit
ad12575a08
  1. 18
      src/Magnum/ShaderTools/Test/AbstractConverterTest.cpp

18
src/Magnum/ShaderTools/Test/AbstractConverterTest.cpp

@ -309,7 +309,14 @@ void AbstractConverterTest::validateDataCustomStringDeleter() {
}
std::pair<bool, Containers::String> doValidateData(Stage, const Containers::ArrayView<const char>) override {
return {{}, Containers::String{"", 0, [](char*, std::size_t){}}};
/* libc++ and MSVC STL is STUPID and doing
`return {{}, Containers::String{...}};`
will do a COPY, even though not needed. That then of course
discards the custom deleter and makes the test fail. Oh C++, do
I really have to reimplement even std::pair, FFS?! */
std::pair<bool, Containers::String> out;
out.second = Containers::String{"", 0, [](char*, std::size_t){}};
return out;
}
} converter;
@ -416,7 +423,14 @@ void AbstractConverterTest::validateFileCustomStringDeleter() {
}
std::pair<bool, Containers::String> doValidateFile(Stage, Containers::StringView) override {
return {{}, Containers::String{"", 0, [](char*, std::size_t){}}};
/* libc++ and MSVC STL is STUPID and doing
`return {{}, Containers::String{...}};`
will do a COPY, even though not needed. That then of course
discards the custom deleter and makes the test fail. Oh C++, do
I really have to reimplement even std::pair, FFS?! */
std::pair<bool, Containers::String> out;
out.second = Containers::String{"", 0, [](char*, std::size_t){}};
return out;
}
} converter;

Loading…
Cancel
Save