Skip to content

Commit

Permalink
Use C++20 features
Browse files Browse the repository at this point in the history
  • Loading branch information
d-frey committed Oct 27, 2024
1 parent c354a8a commit 0859eb7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions include/tao/pq/internal/parameter_traits_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ namespace tao::pq::internal
struct to_chars_helper
: buffer_helper
{
template< typename T >
explicit to_chars_helper( const T v ) noexcept
explicit to_chars_helper( const auto v ) noexcept
{
const auto [ ptr, ec ] = std::to_chars( std::begin( m_buffer ), std::end( m_buffer ), v );
assert( ec == std::errc() );
Expand Down
4 changes: 2 additions & 2 deletions include/tao/pq/table_writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ namespace tao::pq

#if defined( __cpp_pack_indexing )

template< std::size_t... Os, std::size_t... Is, typename... Ts >
template< std::size_t... Os, std::size_t... Is >
void insert_indexed( std::index_sequence< Os... > /*unused*/,
std::index_sequence< Is... > /*unused*/,
const Ts&... ts )
const auto&... ts )
{
std::string buffer;
( ( ts...[ Os ].template copy_to< Is >( buffer ), buffer += '\t' ), ... );
Expand Down
4 changes: 2 additions & 2 deletions include/tao/pq/transaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ namespace tao::pq

#if defined( __cpp_pack_indexing )

template< std::size_t... Os, std::size_t... Is, typename... Ts >
template< std::size_t... Os, std::size_t... Is >
void send_indexed( const char* statement,
std::index_sequence< Os... > /*unused*/,
std::index_sequence< Is... > /*unused*/,
const Ts&... ts )
const auto&... ts )
{
const Oid types[] = { static_cast< Oid >( ts...[ Os ].template type< Is >() )... };
const char* const values[] = { ts...[ Os ].template value< Is >()... };
Expand Down

0 comments on commit 0859eb7

Please sign in to comment.