Skip to content

Commit 7edb3ca

Browse files
committed
Make �iterator_category_value inline instead of static
1 parent 50b4808 commit 7edb3ca

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

include/cpp-sort/adapters/hybrid_adapter.h

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,17 @@ namespace cppsort
4343
// Associate a priority to iterator categories, there is
4444
// probably a trick to automate that...
4545

46-
namespace // GitHub issue #158
47-
{
48-
template<typename>
49-
std::size_t iterator_category_value;
46+
template<typename>
47+
std::size_t iterator_category_value;
5048

51-
template<>
52-
constexpr std::size_t iterator_category_value<std::random_access_iterator_tag> = 2;
49+
template<>
50+
inline constexpr std::size_t iterator_category_value<std::random_access_iterator_tag> = 2;
5351

54-
template<>
55-
constexpr std::size_t iterator_category_value<std::bidirectional_iterator_tag> = 1;
52+
template<>
53+
inline constexpr std::size_t iterator_category_value<std::bidirectional_iterator_tag> = 1;
5654

57-
template<>
58-
constexpr std::size_t iterator_category_value<std::forward_iterator_tag> = 0;
59-
}
55+
template<>
56+
inline constexpr std::size_t iterator_category_value<std::forward_iterator_tag> = 0;
6057

6158
// Avoid just a bit of redundancy
6259
template<typename Iterator, std::size_t N>

0 commit comments

Comments
 (0)