Category : type-alias

Having a type alias using MyVariantType = std::variant<int, double, std::string, bool>; and an alias template, template <typename T> using MyFunctionType = std::function<bool(T)> how can I dynamically create a the following type alias from both MyVariantType and MyFunctionType? using MyFunctionVariantType = std::variant<MyFunctionType<int>, MyFunctionType<double>, MyFunctionType<std::string>, MyFunctionType<bool>> Source: Windows Que..

Read more

#include <type_traits> struct MyType { void operator [](int) const {} }; template<typename T> concept IsMyType1 = requires(T obj) { { obj[0] } using U = std::remove_cvref_t<T>; // error requires std::is_same_v<U, MyType>; }; template<typename T> concept IsMyType2 = requires(T obj) { { obj[0] } requires std::is_same_v<std::remove_cvref_t<T>, MyType>; // okay }; int main() {} Why doesn’t C++20 ..

Read more