Skip to content

Commit bc2e160

Browse files
committed
Fixed compilation for C++11
1 parent 18612ca commit bc2e160

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

include/vista/constant_map.hpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ class constant_map
119119
constexpr value_compare value_comp() const noexcept;
120120

121121
private:
122-
static constexpr storage to_sorted(value_type (&&input)[N]) noexcept(vista::detail::is_nothrow_swappable<value_type>::value);
122+
static VISTA_CXX14_CONSTEXPR
123+
storage to_sorted(value_type (&&input)[N]) noexcept(vista::detail::is_nothrow_swappable<value_type>::value);
123124

124125
private:
125126
// Error functions deliberately left non-constexpr to trigger compile-time error.
@@ -140,7 +141,8 @@ template <typename Key,
140141
typename T,
141142
std::size_t N,
142143
typename Compare = vista::less<Key>>
143-
constexpr auto make_constant_map(pair<Key, T> (&&input)[N]) noexcept(vista::detail::is_nothrow_swappable<decltype(*input)>::value) -> constant_map<Key, T, N, Compare>
144+
VISTA_CXX14_CONSTEXPR
145+
auto make_constant_map(pair<Key, T> (&&input)[N]) noexcept(vista::detail::is_nothrow_swappable<decltype(*input)>::value) -> constant_map<Key, T, N, Compare>
144146
{
145147
return constant_map<Key, T, N, Compare>{ std::forward<decltype(input)>(input) };
146148
}

include/vista/detail/constant_map.ipp

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ constexpr auto constant_map<K, T, N, C>::value_comp() const noexcept -> value_co
6969
}
7070

7171
template <typename K, typename T, std::size_t N, typename C>
72-
constexpr auto constant_map<K, T, N, C>::to_sorted(value_type (&&input)[N]) noexcept(vista::detail::is_nothrow_swappable<value_type>::value) -> storage
72+
VISTA_CXX14_CONSTEXPR
73+
auto constant_map<K, T, N, C>::to_sorted(value_type (&&input)[N]) noexcept(vista::detail::is_nothrow_swappable<value_type>::value) -> storage
7374
{
7475
storage result {};
7576
vista::copy(input, input + N, result.begin());

0 commit comments

Comments
 (0)