Skip to content

Commit

Permalink
Add ostream support
Browse files Browse the repository at this point in the history
  • Loading branch information
d-frey committed Dec 27, 2024
1 parent d4d7484 commit 7d23216
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/tao/pq/internal/format_as.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define TAO_PQ_INTERNAL_FORMAT_AS_HPP

#include <format>
#include <ostream>
#include <utility>

template< typename T >
Expand All @@ -18,4 +19,11 @@ struct std::formatter< T > : std::formatter< decltype( taopq_format_as( std::dec
}
};

template< typename T >
requires requires { taopq_format_as( std::declval< T >() ); }
std::ostream& operator<<( std::ostream& os, const T& v )
{
return os << taopq_format_as( v );
}

#endif

0 comments on commit 7d23216

Please sign in to comment.