#pragma once #if !defined(MIJIN_UTIL_CONCEPTS_HPP_INCLUDED) #define MIJIN_UTIL_CONCEPTS_HPP_INCLUDED 1 #include #include "./traits.hpp" namespace mijin { // // public defines // // // public constants // // // public types // template concept standard_type = std::is_standard_layout_v; template concept trivial_type = std::is_trivial_v; template concept enum_type = std::is_enum_v; template concept arithmetic_type = std::is_arithmetic_v; template concept pointer_type = std::is_pointer_v; template concept reference_type = std::is_reference_v; namespace impl { template using pointer_t = typename T::pointer; } template concept allocator_type = requires(T alloc, typename T::value_type value, detect_or_t pointer, int count) { typename T::value_type; { alloc.allocate(count) } -> std::same_as; { alloc.deallocate(pointer, count) } -> std::same_as; } && !std::is_const_v && !std::is_volatile_v; template concept allocator_type_for = allocator_type && std::is_same_v; template typename T> concept allocator_tmpl = allocator_type>; template concept deleter_type = requires(T deleter, TData* ptr) { deleter(ptr); }; // // public functions // } // namespace mijin #endif // !defined(MIJIN_UTIL_CONCEPTS_HPP_INCLUDED)