From 6dfc53b1dd5c0a0912de9996d2c4dcf1b7287f05 Mon Sep 17 00:00:00 2001 From: Daniel Frey Date: Fri, 15 Nov 2024 22:19:27 +0100 Subject: [PATCH] Include cleanup --- include/tao/pq/connection.hpp | 1 + include/tao/pq/connection_pool.hpp | 1 + include/tao/pq/field.hpp | 1 - include/tao/pq/internal/aggregate.hpp | 1 + include/tao/pq/internal/from_chars.hpp | 2 +- include/tao/pq/internal/gen.hpp | 3 +++ include/tao/pq/internal/parameter_traits_helper.hpp | 1 + include/tao/pq/internal/pool.hpp | 1 + include/tao/pq/large_object.hpp | 2 ++ include/tao/pq/parameter_traits.hpp | 1 - include/tao/pq/parameter_traits_array.hpp | 1 - include/tao/pq/parameter_traits_optional.hpp | 2 ++ include/tao/pq/parameter_traits_pair.hpp | 2 ++ include/tao/pq/parameter_traits_tuple.hpp | 2 ++ include/tao/pq/result.hpp | 3 ++- include/tao/pq/result_traits.hpp | 1 - include/tao/pq/result_traits_aggregate.hpp | 6 ++++++ include/tao/pq/result_traits_array.hpp | 5 +---- include/tao/pq/result_traits_optional.hpp | 2 +- include/tao/pq/result_traits_pair.hpp | 1 + include/tao/pq/result_traits_tuple.hpp | 1 + include/tao/pq/row.hpp | 5 +++-- include/tao/pq/table_field.hpp | 1 - include/tao/pq/table_reader.hpp | 4 ++-- include/tao/pq/table_row.hpp | 3 +-- include/tao/pq/table_writer.hpp | 1 + include/tao/pq/transaction.hpp | 2 +- 27 files changed, 37 insertions(+), 19 deletions(-) diff --git a/include/tao/pq/connection.hpp b/include/tao/pq/connection.hpp index 7ecd336..84a6f6b 100644 --- a/include/tao/pq/connection.hpp +++ b/include/tao/pq/connection.hpp @@ -6,6 +6,7 @@ #define TAO_PQ_CONNECTION_HPP #include +#include #include #include #include diff --git a/include/tao/pq/connection_pool.hpp b/include/tao/pq/connection_pool.hpp index ff0841c..c68ac28 100644 --- a/include/tao/pq/connection_pool.hpp +++ b/include/tao/pq/connection_pool.hpp @@ -6,6 +6,7 @@ #define TAO_PQ_CONNECTION_POOL_HPP #include +#include #include #include #include diff --git a/include/tao/pq/field.hpp b/include/tao/pq/field.hpp index 0babe0f..d4e6dd1 100644 --- a/include/tao/pq/field.hpp +++ b/include/tao/pq/field.hpp @@ -11,7 +11,6 @@ #include #include -#include namespace tao::pq { diff --git a/include/tao/pq/internal/aggregate.hpp b/include/tao/pq/internal/aggregate.hpp index 9d96cc4..45d2d4a 100644 --- a/include/tao/pq/internal/aggregate.hpp +++ b/include/tao/pq/internal/aggregate.hpp @@ -5,6 +5,7 @@ #ifndef TAO_PQ_INTERNAL_AGGREGATE_HPP #define TAO_PQ_INTERNAL_AGGREGATE_HPP +#include #include #include #include diff --git a/include/tao/pq/internal/from_chars.hpp b/include/tao/pq/internal/from_chars.hpp index 9cea66f..06842e7 100644 --- a/include/tao/pq/internal/from_chars.hpp +++ b/include/tao/pq/internal/from_chars.hpp @@ -8,8 +8,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/include/tao/pq/internal/gen.hpp b/include/tao/pq/internal/gen.hpp index f64fb65..b9585e6 100644 --- a/include/tao/pq/internal/gen.hpp +++ b/include/tao/pq/internal/gen.hpp @@ -5,6 +5,9 @@ #ifndef TAO_PQ_INTERNAL_GEN_HPP #define TAO_PQ_INTERNAL_GEN_HPP +#include +#include + #include namespace tao::pq::internal diff --git a/include/tao/pq/internal/parameter_traits_helper.hpp b/include/tao/pq/internal/parameter_traits_helper.hpp index 0ad030e..fc0eefc 100644 --- a/include/tao/pq/internal/parameter_traits_helper.hpp +++ b/include/tao/pq/internal/parameter_traits_helper.hpp @@ -9,6 +9,7 @@ #include #include #include +#include #include diff --git a/include/tao/pq/internal/pool.hpp b/include/tao/pq/internal/pool.hpp index 246450d..80f91d3 100644 --- a/include/tao/pq/internal/pool.hpp +++ b/include/tao/pq/internal/pool.hpp @@ -7,6 +7,7 @@ #include #include +#include #include #include #include diff --git a/include/tao/pq/large_object.hpp b/include/tao/pq/large_object.hpp index 2e6e597..1f27676 100644 --- a/include/tao/pq/large_object.hpp +++ b/include/tao/pq/large_object.hpp @@ -5,10 +5,12 @@ #ifndef TAO_PQ_LARGE_OBJECT_HPP #define TAO_PQ_LARGE_OBJECT_HPP +#include #include #include #include #include +#include #include #include diff --git a/include/tao/pq/parameter_traits.hpp b/include/tao/pq/parameter_traits.hpp index 38d160c..5ea1398 100644 --- a/include/tao/pq/parameter_traits.hpp +++ b/include/tao/pq/parameter_traits.hpp @@ -6,7 +6,6 @@ #define TAO_PQ_PARAMETER_TRAITS_HPP #include -#include #include #include #include diff --git a/include/tao/pq/parameter_traits_array.hpp b/include/tao/pq/parameter_traits_array.hpp index 04f45ad..d09f7d9 100644 --- a/include/tao/pq/parameter_traits_array.hpp +++ b/include/tao/pq/parameter_traits_array.hpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include diff --git a/include/tao/pq/parameter_traits_optional.hpp b/include/tao/pq/parameter_traits_optional.hpp index e040432..3156b21 100644 --- a/include/tao/pq/parameter_traits_optional.hpp +++ b/include/tao/pq/parameter_traits_optional.hpp @@ -5,7 +5,9 @@ #ifndef TAO_PQ_PARAMETER_TRAITS_OPTIONAL_HPP #define TAO_PQ_PARAMETER_TRAITS_OPTIONAL_HPP +#include #include +#include #include #include diff --git a/include/tao/pq/parameter_traits_pair.hpp b/include/tao/pq/parameter_traits_pair.hpp index b5e03be..95f6936 100644 --- a/include/tao/pq/parameter_traits_pair.hpp +++ b/include/tao/pq/parameter_traits_pair.hpp @@ -5,6 +5,8 @@ #ifndef TAO_PQ_PARAMETER_TRAITS_PAIR_HPP #define TAO_PQ_PARAMETER_TRAITS_PAIR_HPP +#include +#include #include #include diff --git a/include/tao/pq/parameter_traits_tuple.hpp b/include/tao/pq/parameter_traits_tuple.hpp index 69f0e9e..25d2dfa 100644 --- a/include/tao/pq/parameter_traits_tuple.hpp +++ b/include/tao/pq/parameter_traits_tuple.hpp @@ -5,6 +5,8 @@ #ifndef TAO_PQ_PARAMETER_TRAITS_TUPLE_HPP #define TAO_PQ_PARAMETER_TRAITS_TUPLE_HPP +#include +#include #include #include #include diff --git a/include/tao/pq/result.hpp b/include/tao/pq/result.hpp index 70945bd..ef9670d 100644 --- a/include/tao/pq/result.hpp +++ b/include/tao/pq/result.hpp @@ -5,6 +5,7 @@ #ifndef TAO_PQ_RESULT_HPP #define TAO_PQ_RESULT_HPP +#include #include #include #include @@ -140,7 +141,7 @@ namespace tao::pq friend void swap( const_iterator& lhs, const_iterator& rhs ) noexcept { - return swap( static_cast< row& >( lhs ), static_cast< row& >( rhs ) ); + swap( static_cast< row& >( lhs ), static_cast< row& >( rhs ) ); } [[nodiscard]] friend auto operator+( const const_iterator& lhs, const difference_type rhs ) noexcept -> const_iterator diff --git a/include/tao/pq/result_traits.hpp b/include/tao/pq/result_traits.hpp index 767a303..a2760ef 100644 --- a/include/tao/pq/result_traits.hpp +++ b/include/tao/pq/result_traits.hpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include diff --git a/include/tao/pq/result_traits_aggregate.hpp b/include/tao/pq/result_traits_aggregate.hpp index b177d01..9e12dd6 100644 --- a/include/tao/pq/result_traits_aggregate.hpp +++ b/include/tao/pq/result_traits_aggregate.hpp @@ -5,7 +5,13 @@ #ifndef TAO_PQ_RESULT_TRAITS_AGGREGATE_HPP #define TAO_PQ_RESULT_TRAITS_AGGREGATE_HPP +#include +#include +#include +#include + #include +#include #include #include diff --git a/include/tao/pq/result_traits_array.hpp b/include/tao/pq/result_traits_array.hpp index 80603d1..a40d8af 100644 --- a/include/tao/pq/result_traits_array.hpp +++ b/include/tao/pq/result_traits_array.hpp @@ -5,14 +5,11 @@ #ifndef TAO_PQ_RESULT_TRAITS_ARRAY_HPP #define TAO_PQ_RESULT_TRAITS_ARRAY_HPP -#include -#include #include #include #include #include #include -#include #include #include #include @@ -80,7 +77,7 @@ namespace tao::pq } else if( *value != '}' ) { if( const auto* end = std::strpbrk( value, ",;}" ) ) { - std::string input( value, end ); + const std::string input( value, end ); if( input == "NULL" ) { if constexpr( requires { result_traits< value_type >::null(); } ) { container.push_back( result_traits< value_type >::null() ); diff --git a/include/tao/pq/result_traits_optional.hpp b/include/tao/pq/result_traits_optional.hpp index b497d0a..7409e8a 100644 --- a/include/tao/pq/result_traits_optional.hpp +++ b/include/tao/pq/result_traits_optional.hpp @@ -5,10 +5,10 @@ #ifndef TAO_PQ_RESULT_TRAITS_OPTIONAL_HPP #define TAO_PQ_RESULT_TRAITS_OPTIONAL_HPP +#include #include #include -#include template< typename T > struct tao::pq::result_traits< std::optional< T > > diff --git a/include/tao/pq/result_traits_pair.hpp b/include/tao/pq/result_traits_pair.hpp index 3ff52a4..f5e24c3 100644 --- a/include/tao/pq/result_traits_pair.hpp +++ b/include/tao/pq/result_traits_pair.hpp @@ -5,6 +5,7 @@ #ifndef TAO_PQ_RESULT_TRAITS_PAIR_HPP #define TAO_PQ_RESULT_TRAITS_PAIR_HPP +#include #include #include diff --git a/include/tao/pq/result_traits_tuple.hpp b/include/tao/pq/result_traits_tuple.hpp index eb930d7..6f38df7 100644 --- a/include/tao/pq/result_traits_tuple.hpp +++ b/include/tao/pq/result_traits_tuple.hpp @@ -5,6 +5,7 @@ #ifndef TAO_PQ_RESULT_TRAITS_TUPLE_HPP #define TAO_PQ_RESULT_TRAITS_TUPLE_HPP +#include #include #include #include diff --git a/include/tao/pq/row.hpp b/include/tao/pq/row.hpp index a2fa848..e75ed8c 100644 --- a/include/tao/pq/row.hpp +++ b/include/tao/pq/row.hpp @@ -136,7 +136,7 @@ namespace tao::pq friend void swap( const_iterator& lhs, const_iterator& rhs ) noexcept { - return swap( static_cast< field& >( lhs ), static_cast< field& >( rhs ) ); + swap( static_cast< field& >( lhs ), static_cast< field& >( rhs ) ); } [[nodiscard]] friend auto operator+( const const_iterator& lhs, const difference_type rhs ) noexcept -> const_iterator @@ -249,7 +249,8 @@ namespace tao::pq return get< T >( 0 ); } - template< typename T, typename = std::enable_if_t< is_aggregate_result< T > > > + template< typename T > + requires is_aggregate_result< T > [[nodiscard]] operator T() const { return as< T >(); diff --git a/include/tao/pq/table_field.hpp b/include/tao/pq/table_field.hpp index 9a28690..3832ee0 100644 --- a/include/tao/pq/table_field.hpp +++ b/include/tao/pq/table_field.hpp @@ -10,7 +10,6 @@ #include #include -#include namespace tao::pq { diff --git a/include/tao/pq/table_reader.hpp b/include/tao/pq/table_reader.hpp index e8b704d..b5046ff 100644 --- a/include/tao/pq/table_reader.hpp +++ b/include/tao/pq/table_reader.hpp @@ -6,12 +6,12 @@ #define TAO_PQ_TABLE_READER_HPP #include +#include #include #include #include #include #include -#include #include #include #include @@ -125,7 +125,7 @@ namespace tao::pq friend void swap( const_iterator& lhs, const_iterator& rhs ) noexcept { - return swap( static_cast< table_row& >( lhs ), static_cast< table_row& >( rhs ) ); + swap( static_cast< table_row& >( lhs ), static_cast< table_row& >( rhs ) ); } [[nodiscard]] friend auto operator==( const const_iterator& lhs, const const_iterator& rhs ) noexcept diff --git a/include/tao/pq/table_row.hpp b/include/tao/pq/table_row.hpp index 6217a99..fcc6f74 100644 --- a/include/tao/pq/table_row.hpp +++ b/include/tao/pq/table_row.hpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include @@ -126,7 +125,7 @@ namespace tao::pq friend void swap( const_iterator& lhs, const_iterator& rhs ) noexcept { - return swap( static_cast< table_field& >( lhs ), static_cast< table_field& >( rhs ) ); + swap( static_cast< table_field& >( lhs ), static_cast< table_field& >( rhs ) ); } [[nodiscard]] friend auto operator+( const const_iterator& lhs, const difference_type rhs ) noexcept -> const_iterator diff --git a/include/tao/pq/table_writer.hpp b/include/tao/pq/table_writer.hpp index 6ed172c..5c2d33e 100644 --- a/include/tao/pq/table_writer.hpp +++ b/include/tao/pq/table_writer.hpp @@ -5,6 +5,7 @@ #ifndef TAO_PQ_TABLE_WRITER_HPP #define TAO_PQ_TABLE_WRITER_HPP +#include #include #include #include diff --git a/include/tao/pq/transaction.hpp b/include/tao/pq/transaction.hpp index b58042a..bc2a269 100644 --- a/include/tao/pq/transaction.hpp +++ b/include/tao/pq/transaction.hpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #if !defined( __cpp_pack_indexing ) && ( __cplusplus >= 202302L ) #include #endif