diff --git a/include/tao/pq/result.hpp b/include/tao/pq/result.hpp index caeb1d7..5075e09 100644 --- a/include/tao/pq/result.hpp +++ b/include/tao/pq/result.hpp @@ -33,13 +33,6 @@ namespace tao::pq class table_writer; class transaction; - namespace internal - { - template< typename T > - concept has_reserve = requires( T t, typename T::size_type s ) { t.reserve( s ); }; - - } // namespace internal - class result final { private: @@ -265,7 +258,7 @@ namespace tao::pq [[nodiscard]] auto as_container() const -> T { T nrv; - if constexpr( internal::has_reserve< T > ) { + if constexpr( requires { nrv.reserve( size() ); } ) { nrv.reserve( size() ); } check_has_result_set(); diff --git a/src/test/pq/has_reserve.cpp b/src/test/pq/has_reserve.cpp deleted file mode 100644 index d6ac2f7..0000000 --- a/src/test/pq/has_reserve.cpp +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2021-2024 Daniel Frey and Dr. Colin Hirsch -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) - -#include - -static_assert( !tao::pq::internal::has_reserve< std::list< int > > ); -static_assert( tao::pq::internal::has_reserve< std::vector< int > > ); - -auto main() -> int -{}