Codechange: Allow ConvertibleThroughBase types to be used as settings. (#13466)
This commit is contained in:
@@ -21,4 +21,12 @@ concept ConvertibleThroughBase = requires(T const a) {
|
||||
{ a.base() } noexcept -> std::convertible_to<int64_t>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Type is convertible to TTo, either directly or through ConvertibleThroughBase.
|
||||
* @tparam T The type under consideration.
|
||||
* @tparam TTo The type to convert to.
|
||||
*/
|
||||
template <typename T, typename TTo>
|
||||
concept ConvertibleThroughBaseOrTo = std::is_convertible_v<T, TTo> || ConvertibleThroughBase<T>;
|
||||
|
||||
#endif /* CONVERTIBLE_THROUGH_BASE_HPP */
|
||||
|
||||
@@ -12,9 +12,6 @@
|
||||
|
||||
#include "../3rdparty/fmt/format.h"
|
||||
|
||||
/** Non-templated base for #StrongType::Typedef for use with type trait queries. */
|
||||
struct StrongTypedefBase {};
|
||||
|
||||
namespace StrongType {
|
||||
/**
|
||||
* Mix-in which makes the new Typedef comparable with itself and its base type.
|
||||
@@ -147,7 +144,7 @@ namespace StrongType {
|
||||
* @tparam TProperties A list of mixins to add to the class.
|
||||
*/
|
||||
template <typename TBaseType, typename TTag, typename... TProperties>
|
||||
struct EMPTY_BASES Typedef : public StrongTypedefBase, public TProperties::template mixin<Typedef<TBaseType, TTag, TProperties...>, TBaseType>... {
|
||||
struct EMPTY_BASES Typedef : public TProperties::template mixin<Typedef<TBaseType, TTag, TProperties...>, TBaseType>... {
|
||||
using BaseType = TBaseType;
|
||||
|
||||
constexpr Typedef() = default;
|
||||
|
||||
Reference in New Issue
Block a user