From 37e02ca8717dfd0128b367dfabb376312c31489a Mon Sep 17 00:00:00 2001 From: rexy712 Date: Wed, 22 Jun 2022 16:43:34 -0700 Subject: [PATCH] Fix C++17 build --- CMakeLists.txt | 2 +- include/rexy/compat/string_base.hpp | 2 +- include/rexy/string_base.tpp | 17 ++++++----------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 239e979..29eb007 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ option(BUILD_TESTS "Enable testing" OFF) option(BUILD_HEADER_ONLY "Enable header only build" OFF) mark_as_advanced(ENABLE_PROFILING) -set(LIBREXY_PUBLIC_HEADERS "include/rexy/rexy.hpp" "include/rexy/algorithm.hpp" "include/rexy/algorithm.tpp" "include/rexy/utility.hpp" "include/rexy/basic_string_hash.hpp" "include/rexy/hash.hpp" "include/rexy/string_view_hash.hpp" "include/rexy/string_hash.hpp" "include/rexy/mpmc_queue.hpp" "include/rexy/mpmc_queue.tpp" "include/rexy/traits.hpp" "include/rexy/steal.hpp" "include/rexy/expression.hpp" "include/rexy/string_base.hpp" "include/rexy/string.hpp" "include/rexy/string_base.tpp" "include/rexy/allocator.hpp" "include/rexy/meta.hpp" "include/rexy/buffer.hpp" "include/rexy/buffer.tpp" "include/rexy/debug_print.hpp" "include/rexy/deferred.hpp" "include/rexy/enum_traits.hpp" "include/rexy/storage_for.hpp" "include/rexy/storage_for.tpp" "include/rexy/visitor.hpp" "include/rexy/string_view.hpp" "include/rexy/string_view.tpp") +set(LIBREXY_PUBLIC_HEADERS "include/rexy/rexy.hpp" "include/rexy/algorithm.hpp" "include/rexy/algorithm.tpp" "include/rexy/utility.hpp" "include/rexy/basic_string_hash.hpp" "include/rexy/hash.hpp" "include/rexy/string_view_hash.hpp" "include/rexy/string_hash.hpp" "include/rexy/mpmc_queue.hpp" "include/rexy/mpmc_queue.tpp" "include/rexy/traits.hpp" "include/rexy/steal.hpp" "include/rexy/expression.hpp" "include/rexy/string_base.hpp" "include/rexy/string.hpp" "include/rexy/string_base.tpp" "include/rexy/allocator.hpp" "include/rexy/meta.hpp" "include/rexy/buffer.hpp" "include/rexy/buffer.tpp" "include/rexy/debug_print.hpp" "include/rexy/deferred.hpp" "include/rexy/enum_traits.hpp" "include/rexy/storage_for.hpp" "include/rexy/storage_for.tpp" "include/rexy/visitor.hpp" "include/rexy/string_view.hpp" "include/rexy/string_view.tpp" "include/rexy/format.hpp" "include/rexy/format.tpp") if(BUILD_HEADER_ONLY) set(LIBREXY_BUILT_LIBRARY_HEADERS "") diff --git a/include/rexy/compat/string_base.hpp b/include/rexy/compat/string_base.hpp index daa4638..7a245d3 100644 --- a/include/rexy/compat/string_base.hpp +++ b/include/rexy/compat/string_base.hpp @@ -28,7 +28,7 @@ namespace rexy{ #ifdef __cpp_concepts #include "cpp20/string_base.hpp" #else - #include "cpp20/string_base.tpp" + #include "cpp17/string_base.hpp" #endif #endif diff --git a/include/rexy/string_base.tpp b/include/rexy/string_base.tpp index fed4426..c17ba82 100644 --- a/include/rexy/string_base.tpp +++ b/include/rexy/string_base.tpp @@ -353,18 +353,13 @@ namespace rexy{ struct insert_adapter{ value_type val; - constexpr insert_adapter& operator++(void)noexcept{ - return *this; - } - constexpr insert_adapter operator++(int)noexcept{ - return *this; - } - constexpr value_type operator*(void)const noexcept{ - return val; - } + constexpr insert_adapter& operator++(void)noexcept{return *this;} + constexpr insert_adapter operator++(int)noexcept{return *this;} + constexpr value_type operator*(void)const noexcept{return val;} + + constexpr bool operator==(const insert_adapter& other)const{return val == other.val;} + constexpr bool operator!=(const insert_adapter& other)const{return val == other.val;} - constexpr bool operator==(const insert_adapter& other)const = default; - constexpr bool operator!=(const insert_adapter& other)const = default; }; return _insert_impl(pos, insert_adapter{v}, insert_count);