Skip to content

Commit 93c7ad2

Browse files
committed
Use nested namespaces where possible (#66)
1 parent b1781b8 commit 93c7ad2

File tree

200 files changed

+483
-919
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+483
-919
lines changed

include/cpp-sort/detail/adaptive_quickselect.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
#include "partition.h"
2828
#include "type_traits.h"
2929

30-
namespace cppsort
31-
{
32-
namespace detail
30+
namespace cppsort::detail
3331
{
3432
namespace median_common_detail
3533
{
@@ -483,6 +481,6 @@ namespace detail
483481
}
484482
return mid;
485483
}
486-
}}
484+
}
487485

488486
#endif // CPPSORT_DETAIL_QUICKSELECT_ADAPTIVE_H_

include/cpp-sort/detail/associate_iterator.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
#include <cpp-sort/utility/iter_move.h>
1414
#include "iterator_traits.h"
1515

16-
namespace cppsort
17-
{
18-
namespace detail
16+
namespace cppsort::detail
1917
{
2018
//
2119
// This header contains utility classes used when an adapter
@@ -355,6 +353,6 @@ namespace detail
355353

356354
Iterator _it;
357355
};
358-
}}
356+
}
359357

360358
#endif // CPPSORT_DETAIL_ASSOCIATE_ITERATOR_H_

include/cpp-sort/detail/binary_tree.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
#include <type_traits>
1212
#include <utility>
1313

14-
namespace cppsort
15-
{
16-
namespace detail
14+
namespace cppsort::detail
1715
{
1816
struct binary_tree_node_base
1917
{
@@ -53,6 +51,6 @@ namespace detail
5351
// Stored value
5452
T value;
5553
};
56-
}}
54+
}
5755

5856
#endif // CPPSORT_DETAIL_BINARY_TREE_H_

include/cpp-sort/detail/bitops.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
#include "config.h"
1515
#include "type_traits.h"
1616

17-
namespace cppsort
18-
{
19-
namespace detail
17+
namespace cppsort::detail
2018
{
2119
// Cast signed value to unsigned one
2220
template<typename Integer>
@@ -137,6 +135,6 @@ namespace detail
137135
constexpr auto n = std::numeric_limits<Unsigned>::digits;
138136
return (x << s) | (x >> (n - s));
139137
}
140-
}}
138+
}
141139

142140
#endif // CPPSORT_DETAIL_BITOPS_H_

include/cpp-sort/detail/boost_common/range.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019-2022 Morwenn
2+
* Copyright (c) 2019-2025 Morwenn
33
* SPDX-License-Identifier: MIT
44
*/
55

@@ -28,11 +28,7 @@
2828
#include "../iterator_traits.h"
2929
#include "../move.h"
3030

31-
namespace cppsort
32-
{
33-
namespace detail
34-
{
35-
namespace boost_common
31+
namespace cppsort::detail::boost_common
3632
{
3733
///---------------------------------------------------------------------------
3834
/// @struct range
@@ -208,6 +204,6 @@ namespace boost_common
208204
compare, projection);
209205
return range<Iter2_t>(dest.first, it_aux);
210206
}
211-
}}}
207+
}
212208

213209
#endif // CPPSORT_DETAIL_BOOST_COMMON_RANGE_H_

include/cpp-sort/detail/boost_common/util/merge.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019-2022 Morwenn
2+
* Copyright (c) 2019-2025 Morwenn
33
* SPDX-License-Identifier: MIT
44
*/
55

@@ -31,13 +31,7 @@
3131
#include "../../merge_move.h"
3232
#include "../../move.h"
3333

34-
namespace cppsort
35-
{
36-
namespace detail
37-
{
38-
namespace boost_common
39-
{
40-
namespace util
34+
namespace cppsort::detail::boost_common::util
4135
{
4236
//-----------------------------------------------------------------------------
4337
// function : merge
@@ -134,6 +128,6 @@ namespace util
134128
end_buf1 - buf1, compare, projection);
135129
return end_buf2;
136130
}
137-
}}}}
131+
}
138132

139133
#endif // CPPSORT_DETAIL_BOOST_COMMON_UTIL_MERGE_H_

include/cpp-sort/detail/bubble_sort.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015-2017 Morwenn
2+
* Copyright (c) 2015-2025 Morwenn
33
* SPDX-License-Identifier: MIT
44
*/
55
#ifndef CPPSORT_DETAIL_BUBBLE_SORT_H_
@@ -12,9 +12,7 @@
1212
#include "iterator_traits.h"
1313
#include "swap_if.h"
1414

15-
namespace cppsort
16-
{
17-
namespace detail
15+
namespace cppsort::detail
1816
{
1917
//
2018
// This sorting algorithm isn't exposed to users of the
@@ -43,6 +41,6 @@ namespace detail
4341
}
4442
}
4543
}
46-
}}
44+
}
4745

4846
#endif // CPPSORT_DETAIL_BUBBLE_SORT_H_

include/cpp-sort/detail/buffered_inplace_merge.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015-2021 Morwenn
2+
* Copyright (c) 2015-2025 Morwenn
33
* SPDX-License-Identifier: MIT
44
*/
55

@@ -29,9 +29,7 @@
2929
#include "move.h"
3030
#include "type_traits.h"
3131

32-
namespace cppsort
33-
{
34-
namespace detail
32+
namespace cppsort::detail
3533
{
3634
////////////////////////////////////////////////////////////
3735
// Blind merge with a buffer
@@ -126,6 +124,6 @@ namespace detail
126124
cppsort::flip(compare), std::move(projection));
127125
}
128126
}
129-
}}
127+
}
130128

131129
#endif // CPPSORT_DETAIL_BUFFERED_INPLACE_MERGE_H_

include/cpp-sort/detail/cartesian_tree_sort.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021-2022 Morwenn
2+
* Copyright (c) 2021-2025 Morwenn
33
* SPDX-License-Identifier: MIT
44
*/
55
#ifndef CPPSORT_DETAIL_CARTESIAN_TREE_SORT_H_
@@ -21,9 +21,7 @@
2121
#include "iterator_traits.h"
2222
#include "type_traits.h"
2323

24-
namespace cppsort
25-
{
26-
namespace detail
24+
namespace cppsort::detail
2725
{
2826
template<typename T>
2927
struct cartesian_tree
@@ -157,6 +155,6 @@ namespace detail
157155
}
158156
}
159157
}
160-
}}
158+
}
161159

162160
#endif // CPPSORT_DETAIL_CARTESIAN_TREE_SORT_H_

include/cpp-sort/detail/checkers.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
#include <cpp-sort/sorter_traits.h>
1313
#include "raw_checkers.h"
1414

15-
namespace cppsort
16-
{
17-
namespace detail
15+
namespace cppsort::detail
1816
{
1917
////////////////////////////////////////////////////////////
2018
// High-level checkers (check with sorter_traits)
@@ -56,6 +54,6 @@ namespace detail
5654
Sorters...
5755
>
5856
{};
59-
}}
57+
}
6058

6159
#endif // CPPSORT_DETAIL_CHECKERS_H_

0 commit comments

Comments
 (0)