clang-format

This commit is contained in:
Guillaume Meunier
2024-03-30 17:00:34 +01:00
parent bb660cfb3f
commit 9cceaac648
122 changed files with 2904 additions and 2783 deletions
+19 -17
View File
@@ -26,33 +26,35 @@
namespace utils
{
template<typename T>
concept has_const_iterator = requires {
std::declval<typename T::const_iterator>();
};
template <typename T>
concept has_const_iterator = requires {
std::declval<typename T::const_iterator>();
};
template<typename T, bool> struct get_const_iterator_aux;
template <typename T, bool>
struct get_const_iterator_aux;
template<typename T> struct get_const_iterator_aux<T, true>
{
using const_iterator = T::const_iterator;
};
template <typename T>
struct get_const_iterator_aux<T, true>
{
using const_iterator = T::const_iterator;
};
template<typename T> struct get_const_iterator_aux<T, false>
{
using const_iterator = T::iterator;
};
template<typename T>
using get_const_iterator = get_const_iterator_aux<T, has_const_iterator<T>>::const_iterator;
template <typename T>
struct get_const_iterator_aux<T, false>
{
using const_iterator = T::iterator;
};
template <typename T>
using get_const_iterator = get_const_iterator_aux<T, has_const_iterator<T>>::const_iterator;
template <typename T>
struct enumerate_range
{
struct iterator
{
using underlying_iterator = std::conditional_t<std::is_const_v<T>, get_const_iterator<T>, typename T::iterator>;
using underlying_iterator = std::conditional_t<std::is_const_v<T>, get_const_iterator<T>, typename T::iterator>;
using underlying_value_type = std::conditional_t<std::is_const_v<T>, const typename T::value_type, typename T::value_type>;
size_t index;