-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider updating Overload C++ version from 17 to 20 #294
Labels
Comments
adriengivry
added
Feature
New feature to the engine
Optimization
Optimization related stuff
labels
Dec 12, 2023
After some investigation, it looks like C++20 introduces some regressions, notably this one: In our if constexpr (...)
{
}
else
{
static_assert(false, "...");
} This doesn't compile with C++20 while it should. This shouldn't prevent us from updating, as this issue could be mitigated, by using concepts for instance: Concept declaration: template<class T>
concept IniType =
std::is_same<bool, T>::value ||
std::is_same<std::string, T>::value ||
std::is_integral<T>::value ||
std::is_floating_point<T>::value; Usage: template<IniType T>
T Get(const std::string& p_key);
template<IniType T>
T GetOrDefault(const std::string& p_key, T p_default);
template<IniType T>
bool Set(const std::string& p_key, const T& p_value);
template<IniType T>
bool Add(const std::string& p_key, const T& p_value); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now that C++20 is widely available and support, we should consider updating Overload to take advantage of it.
Some features we could use from C++20:
std::string::ends_with
andstd::string::starts_with
contains
std::map
andstd::set
in some places, and we could use this featureconsteval
derived_from
,convertible_to
...)std::span
std::make_shared<int[]>(5)
std::bit_cast
PipelineState
erase_if
remove_if
+erase
, it would simplify a bunch of our codesource_location::current()
__LINE__
and__FILE__
, to trace assert locationsstd::bind_front
std::bind
withstd::placeholder::_1
(shorter syntax)std::lerp
OvMaths
and might be better vectorized... and more!
The text was updated successfully, but these errors were encountered: