diff --git a/sprout/cinttypes/abs.hpp b/sprout/cinttypes/abs.hpp index 6f4b5a73..c635817d 100644 --- a/sprout/cinttypes/abs.hpp +++ b/sprout/cinttypes/abs.hpp @@ -7,7 +7,7 @@ #include namespace sprout { - SPROUT_CONSTEXPR std::intmax_t imaxabs(std::intmax_t j) { + inline SPROUT_CONSTEXPR std::intmax_t imaxabs(std::intmax_t j) { return j < 0 ? -j : j; } } // namespace sprout diff --git a/sprout/cinttypes/div.hpp b/sprout/cinttypes/div.hpp index 6cbdc1a8..7a02e5b7 100644 --- a/sprout/cinttypes/div.hpp +++ b/sprout/cinttypes/div.hpp @@ -32,7 +32,7 @@ namespace sprout { sprout::detail::div_t_traits2::offsetof_quot == 0 >::type = sprout::enabler > - SPROUT_CONSTEXPR typename sprout::detail::div_t_traits2::type div_impl2(T const& numer, T const& denom) { + inline SPROUT_CONSTEXPR typename sprout::detail::div_t_traits2::type div_impl2(T const& numer, T const& denom) { return {numer / denom, numer % denom}; } @@ -42,7 +42,7 @@ namespace sprout { sprout::detail::div_t_traits2::offsetof_rem == 0 >::type = sprout::enabler > - SPROUT_CONSTEXPR typename sprout::detail::div_t_traits2::type div_impl2(T const &numer, T const& denom) { + inline SPROUT_CONSTEXPR typename sprout::detail::div_t_traits2::type div_impl2(T const &numer, T const& denom) { return {numer % denom, numer / denom}; } } // namespace detail @@ -55,7 +55,7 @@ namespace sprout { typename T, typename sprout::enabler_if::value>::type = sprout::enabler > - SPROUT_CONSTEXPR std::imaxdiv_t div(T numer, T denom) { + inline SPROUT_CONSTEXPR std::imaxdiv_t div(T numer, T denom) { return sprout::imaxdiv(numer, denom); } } // namespace sprout diff --git a/sprout/complex.hpp b/sprout/complex.hpp index e3eb27b4..34dfff14 100644 --- a/sprout/complex.hpp +++ b/sprout/complex.hpp @@ -118,63 +118,63 @@ namespace sprout { }; // 26.4.6, operators: template - SPROUT_CONSTEXPR sprout::complex operator+(sprout::complex const& lhs, sprout::complex const& rhs) { + inline SPROUT_CONSTEXPR sprout::complex operator+(sprout::complex const& lhs, sprout::complex const& rhs) { return sprout::complex( lhs.real() + rhs.real(), lhs.imag() + rhs.imag() ); } template - SPROUT_CONSTEXPR sprout::complex operator+(sprout::complex const& lhs, T const& rhs) { + inline SPROUT_CONSTEXPR sprout::complex operator+(sprout::complex const& lhs, T const& rhs) { return sprout::complex( lhs.real() + rhs, lhs.imag() ); } template - SPROUT_CONSTEXPR sprout::complex operator+(T const& lhs, sprout::complex const& rhs) { + inline SPROUT_CONSTEXPR sprout::complex operator+(T const& lhs, sprout::complex const& rhs) { return sprout::complex( lhs + rhs.real(), rhs.imag() ); } template - SPROUT_CONSTEXPR sprout::complex operator-(sprout::complex const& lhs, sprout::complex const& rhs) { + inline SPROUT_CONSTEXPR sprout::complex operator-(sprout::complex const& lhs, sprout::complex const& rhs) { return sprout::complex( lhs.real() - rhs.real(), lhs.imag() - rhs.imag() ); } template - SPROUT_CONSTEXPR sprout::complex operator-(sprout::complex const& lhs, T const& rhs) { + inline SPROUT_CONSTEXPR sprout::complex operator-(sprout::complex const& lhs, T const& rhs) { return sprout::complex( lhs.real() - rhs, lhs.imag() ); } template - SPROUT_CONSTEXPR sprout::complex operator-(T const& lhs, sprout::complex const& rhs) { + inline SPROUT_CONSTEXPR sprout::complex operator-(T const& lhs, sprout::complex const& rhs) { return sprout::complex( lhs - rhs.real(), -rhs.imag() ); } template - SPROUT_CONSTEXPR sprout::complex operator*(sprout::complex const& lhs, sprout::complex const& rhs) { + inline SPROUT_CONSTEXPR sprout::complex operator*(sprout::complex const& lhs, sprout::complex const& rhs) { return sprout::complex( lhs.real() * rhs.real() - lhs.imag() * rhs.imag(), lhs.real() * rhs.imag() + lhs.imag() * rhs.real() ); } template - SPROUT_CONSTEXPR sprout::complex operator*(sprout::complex const& lhs, T const& rhs) { + inline SPROUT_CONSTEXPR sprout::complex operator*(sprout::complex const& lhs, T const& rhs) { return sprout::complex( lhs.real() * rhs, lhs.imag() * rhs ); } template - SPROUT_CONSTEXPR sprout::complex operator*(T const& lhs, sprout::complex const& rhs) { + inline SPROUT_CONSTEXPR sprout::complex operator*(T const& lhs, sprout::complex const& rhs) { return sprout::complex( lhs * rhs.real(), lhs * rhs.imag() @@ -182,7 +182,7 @@ namespace sprout { } namespace detail { template - SPROUT_CONSTEXPR sprout::complex divides_impl( + inline SPROUT_CONSTEXPR sprout::complex divides_impl( sprout::complex const& lhs, sprout::complex const& rhs, T const& n @@ -194,7 +194,7 @@ namespace sprout { ); } template - SPROUT_CONSTEXPR sprout::complex divides_impl( + inline SPROUT_CONSTEXPR sprout::complex divides_impl( T const& lhs, sprout::complex const& rhs, T const& n @@ -207,50 +207,50 @@ namespace sprout { } } // namespace detail template - SPROUT_CONSTEXPR sprout::complex operator/(sprout::complex const& lhs, sprout::complex const& rhs) { + inline SPROUT_CONSTEXPR sprout::complex operator/(sprout::complex const& lhs, sprout::complex const& rhs) { return sprout::detail::divides_impl(lhs, rhs, sprout::norm(rhs)); } template - SPROUT_CONSTEXPR sprout::complex operator/(sprout::complex const& lhs, T const& rhs) { + inline SPROUT_CONSTEXPR sprout::complex operator/(sprout::complex const& lhs, T const& rhs) { return sprout::complex( lhs.real() / rhs, lhs.imag() / rhs ); } template - SPROUT_CONSTEXPR sprout::complex operator/(T const& lhs, sprout::complex const& rhs) { + inline SPROUT_CONSTEXPR sprout::complex operator/(T const& lhs, sprout::complex const& rhs) { return sprout::detail::divides_impl(lhs, rhs, sprout::norm(rhs)); } template - SPROUT_CONSTEXPR sprout::complex operator+(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex operator+(sprout::complex const& x) { return x; } template - SPROUT_CONSTEXPR sprout::complex operator-(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex operator-(sprout::complex const& x) { return sprout::complex(-x.real(), -x.imag()); } template - SPROUT_CONSTEXPR bool operator==(sprout::complex const& lhs, sprout::complex const& rhs) { + inline SPROUT_CONSTEXPR bool operator==(sprout::complex const& lhs, sprout::complex const& rhs) { return lhs.real() == rhs.real() && lhs.imag() == rhs.imag(); } template - SPROUT_CONSTEXPR bool operator==(sprout::complex const& lhs, T const& rhs) { + inline SPROUT_CONSTEXPR bool operator==(sprout::complex const& lhs, T const& rhs) { return lhs.real() == rhs && lhs.imag() == T(); } template - SPROUT_CONSTEXPR bool operator==(T const& lhs, sprout::complex const& rhs) { + inline SPROUT_CONSTEXPR bool operator==(T const& lhs, sprout::complex const& rhs) { return lhs == rhs.real() && T() == rhs.imag(); } template - SPROUT_CONSTEXPR bool operator!=(sprout::complex const& lhs, sprout::complex const& rhs) { + inline SPROUT_CONSTEXPR bool operator!=(sprout::complex const& lhs, sprout::complex const& rhs) { return !(lhs == rhs); } template - SPROUT_CONSTEXPR bool operator!=(sprout::complex const& lhs, T const& rhs) { + inline SPROUT_CONSTEXPR bool operator!=(sprout::complex const& lhs, T const& rhs) { return !(lhs == rhs); } template - SPROUT_CONSTEXPR bool operator!=(T const& lhs, sprout::complex const& rhs) { + inline SPROUT_CONSTEXPR bool operator!=(T const& lhs, sprout::complex const& rhs) { return !(lhs == rhs); } template @@ -285,32 +285,32 @@ namespace sprout { } // 26.4.7, values: template - SPROUT_CONSTEXPR T real(sprout::complex const& x) { + inline SPROUT_CONSTEXPR T real(sprout::complex const& x) { return x.real(); } template - SPROUT_CONSTEXPR T imag(sprout::complex const& x) { + inline SPROUT_CONSTEXPR T imag(sprout::complex const& x) { return x.imag(); } template - SPROUT_CONSTEXPR T abs(sprout::complex const& x) { + inline SPROUT_CONSTEXPR T abs(sprout::complex const& x) { return sprout::sqrt(sprout::norm(x)); } template - SPROUT_CONSTEXPR T arg(sprout::complex const& x) { + inline SPROUT_CONSTEXPR T arg(sprout::complex const& x) { return sprout::atan2(x.imag(), x.real()); } template - SPROUT_CONSTEXPR T norm(sprout::complex const& x) { + inline SPROUT_CONSTEXPR T norm(sprout::complex const& x) { return x.real() * x.real() + x.imag() * x.imag(); } template - SPROUT_CONSTEXPR sprout::complex conj(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex conj(sprout::complex const& x) { return sprout::complex(x.real(), -x.imag()); } namespace detail { template - SPROUT_CONSTEXPR sprout::complex proj_impl(sprout::complex const& x, T const& den) { + inline SPROUT_CONSTEXPR sprout::complex proj_impl(sprout::complex const& x, T const& den) { return sprout::complex( T(2) * x.real() / den, T(2) * x.imag() / den @@ -318,14 +318,14 @@ namespace sprout { } } // detail template - SPROUT_CONSTEXPR sprout::complex proj(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex proj(sprout::complex const& x) { return sprout::detail::proj_impl( x, sprout::norm(x) + T(1) ); } template - SPROUT_CONSTEXPR sprout::complex polar(T const& rho, T const& theta = 0) { + inline SPROUT_CONSTEXPR sprout::complex polar(T const& rho, T const& theta = 0) { return sprout::complex(rho * sprout::cos(theta), rho * sprout::sin(theta)); } // 26.4.8, transcendentals: @@ -369,27 +369,27 @@ namespace sprout { SPROUT_CONSTEXPR sprout::complex tanh(sprout::complex const& x); namespace detail { template - SPROUT_CONSTEXPR sprout::complex acos_impl(sprout::complex const& t) { + inline SPROUT_CONSTEXPR sprout::complex acos_impl(sprout::complex const& t) { return sprout::complex(sprout::math::half_pi() - t.real(), -t.imag()); } } // namespace detail template - SPROUT_CONSTEXPR sprout::complex acos(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex acos(sprout::complex const& x) { return sprout::detail::acos_impl(sprout::asin(x)); } namespace detail { template - SPROUT_CONSTEXPR sprout::complex asin_impl(sprout::complex const& t) { + inline SPROUT_CONSTEXPR sprout::complex asin_impl(sprout::complex const& t) { return sprout::complex(t.imag(), -t.real()); } } // namespace detail template - SPROUT_CONSTEXPR sprout::complex asin(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex asin(sprout::complex const& x) { return sprout::detail::asin_impl(sprout::asinh(sprout::complex(-x.imag(), x.real()))); } namespace detail { template - SPROUT_CONSTEXPR sprout::complex atan_impl_1( + inline SPROUT_CONSTEXPR sprout::complex atan_impl_1( sprout::complex const& x, T const& r2, T const& z, @@ -403,7 +403,7 @@ namespace sprout { ); } template - SPROUT_CONSTEXPR sprout::complex atan_impl( + inline SPROUT_CONSTEXPR sprout::complex atan_impl( sprout::complex const& x, T const& r2 ) @@ -418,15 +418,15 @@ namespace sprout { } } // namespace detail template - SPROUT_CONSTEXPR sprout::complex atan(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex atan(sprout::complex const& x) { return sprout::detail::atan_impl(x, x.real() * x.real()); } template - SPROUT_CONSTEXPR sprout::complex acosh(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex acosh(sprout::complex const& x) { return T(2) * sprout::log(sprout::sqrt(T(0.5) * (x + T(1))) + sprout::sqrt(T(0.5) * (x - T(1)))); } template - SPROUT_CONSTEXPR sprout::complex asinh(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex asinh(sprout::complex const& x) { return sprout::log( sprout::sqrt( sprout::complex( @@ -439,7 +439,7 @@ namespace sprout { } namespace detail { template - SPROUT_CONSTEXPR sprout::complex atanh_impl_1( + inline SPROUT_CONSTEXPR sprout::complex atanh_impl_1( sprout::complex const& x, T const& i2, T const& z, @@ -453,7 +453,7 @@ namespace sprout { ); } template - SPROUT_CONSTEXPR sprout::complex atanh_impl( + inline SPROUT_CONSTEXPR sprout::complex atanh_impl( sprout::complex const& x, T const& i2 ) @@ -468,69 +468,69 @@ namespace sprout { } } // namespace detail template - SPROUT_CONSTEXPR sprout::complex atanh(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex atanh(sprout::complex const& x) { return sprout::detail::atanh_impl(x, x.imag() * x.imag()); } template - SPROUT_CONSTEXPR sprout::complex cos(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex cos(sprout::complex const& x) { return sprout::complex( sprout::cos(x.real()) * sprout::cosh(x.imag()), -(sprout::sin(x.real()) * sprout::sinh(x.imag())) ); } template - SPROUT_CONSTEXPR sprout::complex cosh(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex cosh(sprout::complex const& x) { return sprout::complex( sprout::cosh(x.real()) * sprout::cos(x.imag()), sprout::sinh(x.real()) * sprout::sin(x.imag()) ); } template - SPROUT_CONSTEXPR sprout::complex exp(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex exp(sprout::complex const& x) { return sprout::polar(sprout::exp(x.real()), x.imag()); } template - SPROUT_CONSTEXPR sprout::complex log(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex log(sprout::complex const& x) { return sprout::complex(sprout::log(sprout::abs(x)), sprout::arg(x)); } template - SPROUT_CONSTEXPR sprout::complex log10(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex log10(sprout::complex const& x) { return sprout::log(x) / sprout::log(T(10)); } namespace detail { template - SPROUT_CONSTEXPR sprout::complex pow_impl(sprout::complex const& t, T const& y) { + inline SPROUT_CONSTEXPR sprout::complex pow_impl(sprout::complex const& t, T const& y) { return sprout::polar(sprout::exp(y * t.real()), y * t.imag()); } } // namespace detail template - SPROUT_CONSTEXPR sprout::complex pow(sprout::complex const& x, T const& y) { + inline SPROUT_CONSTEXPR sprout::complex pow(sprout::complex const& x, T const& y) { return x == T() ? T() : x.imag() == T() && x.real() > T() ? sprout::pow(x.real(), y) : sprout::detail::pow_impl(sprout::log(x), y) ; } template - SPROUT_CONSTEXPR sprout::complex pow(sprout::complex const& x, sprout::complex const& y) { + inline SPROUT_CONSTEXPR sprout::complex pow(sprout::complex const& x, sprout::complex const& y) { return x == T() ? T() : sprout::exp(y * sprout::log(x)) ; } template - SPROUT_CONSTEXPR sprout::complex pow(T const& x, sprout::complex const& y) { + inline SPROUT_CONSTEXPR sprout::complex pow(T const& x, sprout::complex const& y) { return x > T() ? sprout::polar(sprout::pow(x, y.real()), y.imag() * sprout::log(x)) : sprout::pow(sprout::complex(x), y) ; } template - SPROUT_CONSTEXPR sprout::complex sin(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex sin(sprout::complex const& x) { return sprout::complex( sprout::sin(x.real()) * sprout::cosh(x.imag()), sprout::cos(x.real()) * sprout::sinh(x.imag()) ); } template - SPROUT_CONSTEXPR sprout::complex sinh(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex sinh(sprout::complex const& x) { return sprout::complex( sprout::sinh(x.real()) * sprout::cos(x.imag()), sprout::cosh(x.real()) * sprout::sin(x.imag()) @@ -538,49 +538,49 @@ namespace sprout { } namespace detail { template - SPROUT_CONSTEXPR sprout::complex sqrt_impl_1(sprout::complex const& x, T const& t) { + inline SPROUT_CONSTEXPR sprout::complex sqrt_impl_1(sprout::complex const& x, T const& t) { return sprout::complex(t, x.imag() < T() ? -t : t); } template - SPROUT_CONSTEXPR sprout::complex sqrt_impl_2_1(sprout::complex const& x, T const& t, T const& u) { + inline SPROUT_CONSTEXPR sprout::complex sqrt_impl_2_1(sprout::complex const& x, T const& t, T const& u) { return x.real() > T() ? sprout::complex(u, x.imag() / t) : sprout::complex(sprout::abs(x.imag()) / t, x.imag() < T() ? -u : u) ; } template - SPROUT_CONSTEXPR sprout::complex sqrt_impl_2(sprout::complex const& x, T const& t) { + inline SPROUT_CONSTEXPR sprout::complex sqrt_impl_2(sprout::complex const& x, T const& t) { return sprout::detail::sqrt_impl_2_1(x, t, t / 2); } } // namespace detail template - SPROUT_CONSTEXPR sprout::complex sqrt(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex sqrt(sprout::complex const& x) { return x.real() == T() ? sprout::detail::sqrt_impl_1(x, sprout::sqrt(abs(x.imag()) / 2)) : sprout::detail::sqrt_impl_2(x, sprout::sqrt(2 * (sprout::abs(x) + sprout::abs(x.real())))) ; } template - SPROUT_CONSTEXPR sprout::complex tan(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex tan(sprout::complex const& x) { return sprout::sin(x) / sprout::cos(x); } template - SPROUT_CONSTEXPR sprout::complex tanh(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex tanh(sprout::complex const& x) { return sprout::sinh(x) / sprout::cosh(x); } template - SPROUT_CONSTEXPR sprout::complex ceil(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex ceil(sprout::complex const& x) { return sprout::complex(sprout::ceil(x.real()), sprout::ceil(x.imag())); } template - SPROUT_CONSTEXPR sprout::complex floor(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex floor(sprout::complex const& x) { return sprout::complex(sprout::floor(x.real()), sprout::floor(x.imag())); } template - SPROUT_CONSTEXPR sprout::complex trunc(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex trunc(sprout::complex const& x) { return sprout::complex(sprout::trunc(x.real()), sprout::trunc(x.imag())); } template - SPROUT_CONSTEXPR sprout::complex round(sprout::complex const& x) { + inline SPROUT_CONSTEXPR sprout::complex round(sprout::complex const& x) { return sprout::complex(sprout::round(x.real()), sprout::round(x.imag())); } } // namespace sprout diff --git a/sprout/container/container_construct_traits.hpp b/sprout/container/container_construct_traits.hpp index 0ee39a0f..3d7bda57 100644 --- a/sprout/container/container_construct_traits.hpp +++ b/sprout/container/container_construct_traits.hpp @@ -14,7 +14,7 @@ namespace sprout { namespace detail { template - SPROUT_CONSTEXPR typename sprout::container_construct_traits::copied_type + inline SPROUT_CONSTEXPR typename sprout::container_construct_traits::copied_type default_make_container(Args&&... args) { typedef typename sprout::container_construct_traits::copied_type copied_type; return copied_type{{sprout::forward(args)...}}; diff --git a/sprout/container/internal_begin.hpp b/sprout/container/internal_begin.hpp index 7721b34b..a2c3673d 100644 --- a/sprout/container/internal_begin.hpp +++ b/sprout/container/internal_begin.hpp @@ -22,7 +22,7 @@ namespace sprout { return sprout::begin(sprout::get_internal(cont)); } template - SPROUT_CONSTEXPR typename sprout::container_traits< + inline SPROUT_CONSTEXPR typename sprout::container_traits< typename std::remove_reference< typename sprout::containers::internal::type >::type @@ -34,7 +34,7 @@ namespace sprout { // internal_cbegin // template - SPROUT_CONSTEXPR typename sprout::container_traits< + inline SPROUT_CONSTEXPR typename sprout::container_traits< typename std::remove_reference< typename sprout::containers::internal::type >::type diff --git a/sprout/container/internal_begin_offset.hpp b/sprout/container/internal_begin_offset.hpp index 7e6bbe5c..a27ee87f 100644 --- a/sprout/container/internal_begin_offset.hpp +++ b/sprout/container/internal_begin_offset.hpp @@ -12,7 +12,8 @@ namespace sprout { // internal_begin_offset // template - SPROUT_CONSTEXPR typename sprout::container_traits::difference_type internal_begin_offset(Container const& cont) { + inline SPROUT_CONSTEXPR typename sprout::container_traits::difference_type + internal_begin_offset(Container const& cont) { return NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), sprout::begin(cont)); } } // namespace sprout diff --git a/sprout/container/internal_begin_offset_backward.hpp b/sprout/container/internal_begin_offset_backward.hpp index 774f5d37..e817d39d 100644 --- a/sprout/container/internal_begin_offset_backward.hpp +++ b/sprout/container/internal_begin_offset_backward.hpp @@ -12,7 +12,8 @@ namespace sprout { // internal_begin_offset_backward // template - SPROUT_CONSTEXPR typename sprout::container_traits::difference_type internal_begin_offset_backward(Container const& cont) { + inline SPROUT_CONSTEXPR typename sprout::container_traits::difference_type + internal_begin_offset_backward(Container const& cont) { return NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(cont), sprout::internal_end(cont)); } } // namespace sprout diff --git a/sprout/container/internal_end.hpp b/sprout/container/internal_end.hpp index 203632b9..f77b5195 100644 --- a/sprout/container/internal_end.hpp +++ b/sprout/container/internal_end.hpp @@ -22,7 +22,7 @@ namespace sprout { return sprout::end(sprout::get_internal(cont)); } template - SPROUT_CONSTEXPR typename sprout::container_traits< + inline SPROUT_CONSTEXPR typename sprout::container_traits< typename std::remove_reference< typename sprout::containers::internal::type >::type @@ -34,7 +34,7 @@ namespace sprout { // internal_cend // template - SPROUT_CONSTEXPR typename sprout::container_traits< + inline SPROUT_CONSTEXPR typename sprout::container_traits< typename std::remove_reference< typename sprout::containers::internal::type >::type diff --git a/sprout/container/internal_end_offset.hpp b/sprout/container/internal_end_offset.hpp index 6363e3ff..748fb0bc 100644 --- a/sprout/container/internal_end_offset.hpp +++ b/sprout/container/internal_end_offset.hpp @@ -12,7 +12,8 @@ namespace sprout { // internal_end_offset // template - SPROUT_CONSTEXPR typename sprout::container_traits::difference_type internal_end_offset(Container const& cont) { + inline SPROUT_CONSTEXPR typename sprout::container_traits::difference_type + internal_end_offset(Container const& cont) { return NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), sprout::end(cont)); } } // namespace sprout diff --git a/sprout/container/internal_end_offset_backward.hpp b/sprout/container/internal_end_offset_backward.hpp index 1b1ddcfb..ca299915 100644 --- a/sprout/container/internal_end_offset_backward.hpp +++ b/sprout/container/internal_end_offset_backward.hpp @@ -12,7 +12,8 @@ namespace sprout { // internal_end_offset_backward // template - SPROUT_CONSTEXPR typename sprout::container_traits::difference_type internal_end_offset_backward(Container const& cont) { + inline SPROUT_CONSTEXPR typename sprout::container_traits::difference_type + internal_end_offset_backward(Container const& cont) { return NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::end(cont), sprout::internal_end(cont)); } } // namespace sprout diff --git a/sprout/cstdlib/abs.hpp b/sprout/cstdlib/abs.hpp index 3aa456e5..879fcfd3 100644 --- a/sprout/cstdlib/abs.hpp +++ b/sprout/cstdlib/abs.hpp @@ -9,23 +9,23 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 7.20.6.1 abs,labs,及び llabs 関数 - SPROUT_CONSTEXPR int abs(int j) { + inline SPROUT_CONSTEXPR int abs(int j) { return j < 0 ? -j : j; } - SPROUT_CONSTEXPR long labs(long j) { + inline SPROUT_CONSTEXPR long labs(long j) { return j < 0 ? -j : j; } - SPROUT_CONSTEXPR long long llabs(long long j) { + inline SPROUT_CONSTEXPR long long llabs(long long j) { return j < 0 ? -j : j; } - SPROUT_CONSTEXPR long abs(long j) { + inline SPROUT_CONSTEXPR long abs(long j) { return sprout::labs(j); } - SPROUT_CONSTEXPR long long abs(long long j) { + inline SPROUT_CONSTEXPR long long abs(long long j) { return sprout::llabs(j); } @@ -36,7 +36,7 @@ namespace sprout { std::is_integral::value && std::is_signed::value >::type = sprout::enabler > - SPROUT_CONSTEXPR IntType abs(IntType j) { + inline SPROUT_CONSTEXPR IntType abs(IntType j) { return j < 0 ? -j : j; } template< @@ -45,7 +45,7 @@ namespace sprout { std::is_integral::value && std::is_unsigned::value >::type = sprout::enabler > - SPROUT_CONSTEXPR IntType abs(IntType j) { + inline SPROUT_CONSTEXPR IntType abs(IntType j) { return j; } } // anonymous-namespace diff --git a/sprout/cstdlib/div.hpp b/sprout/cstdlib/div.hpp index bdb2c84e..1e209b86 100644 --- a/sprout/cstdlib/div.hpp +++ b/sprout/cstdlib/div.hpp @@ -34,7 +34,7 @@ namespace sprout { sprout::detail::div_t_traits::offsetof_quot == 0 >::type = sprout::enabler > - SPROUT_CONSTEXPR typename sprout::detail::div_t_traits::type div_impl(T const& numer, T const& denom) { + inline SPROUT_CONSTEXPR typename sprout::detail::div_t_traits::type div_impl(T const& numer, T const& denom) { return {numer / denom, numer % denom}; } @@ -44,29 +44,29 @@ namespace sprout { sprout::detail::div_t_traits::offsetof_rem == 0 >::type = sprout::enabler > - SPROUT_CONSTEXPR typename sprout::detail::div_t_traits::type div_impl(T const &numer, T const& denom) { + inline SPROUT_CONSTEXPR typename sprout::detail::div_t_traits::type div_impl(T const &numer, T const& denom) { return {numer % denom, numer / denom}; } } // namespace detail // 7.20.6.2 div,ldiv,及び lldiv 関数 - SPROUT_CONSTEXPR std::div_t div(int numer, int denom) { + inline SPROUT_CONSTEXPR std::div_t div(int numer, int denom) { return sprout::detail::div_impl(numer, denom); } - SPROUT_CONSTEXPR std::ldiv_t ldiv(long numer, long denom) { + inline SPROUT_CONSTEXPR std::ldiv_t ldiv(long numer, long denom) { return sprout::detail::div_impl(numer, denom); } - SPROUT_CONSTEXPR std::lldiv_t lldiv(long long numer, long long denom) { + inline SPROUT_CONSTEXPR std::lldiv_t lldiv(long long numer, long long denom) { return sprout::detail::div_impl(numer, denom); } - SPROUT_CONSTEXPR std::ldiv_t div(long numer, long denom) { + inline SPROUT_CONSTEXPR std::ldiv_t div(long numer, long denom) { return sprout::ldiv(numer, denom); } - SPROUT_CONSTEXPR std::lldiv_t div(long long numer, long long denom) { + inline SPROUT_CONSTEXPR std::lldiv_t div(long long numer, long long denom) { return sprout::lldiv(numer, denom); } } // namespace sprout diff --git a/sprout/ctype/ascii.hpp b/sprout/ctype/ascii.hpp index a51a2857..f2feed31 100644 --- a/sprout/ctype/ascii.hpp +++ b/sprout/ctype/ascii.hpp @@ -153,25 +153,25 @@ namespace sprout { /* 0x7E '~' */ sprout::ascii::detail::graph | sprout::ascii::detail::print | sprout::ascii::detail::punct, /* 0x7F DEL */ sprout::ascii::detail::cntrl }; - SPROUT_CONSTEXPR std::size_t get_value(char c) { + inline SPROUT_CONSTEXPR std::size_t get_value(char c) { return static_cast(c) < sprout::ascii::detail::table_size ? sprout::ascii::detail::table[static_cast(c)] : 0 ; } - SPROUT_CONSTEXPR std::size_t get_value(wchar_t c) { + inline SPROUT_CONSTEXPR std::size_t get_value(wchar_t c) { return static_cast(c) < sprout::ascii::detail::table_size ? sprout::ascii::detail::table[static_cast(c)] : 0 ; } - SPROUT_CONSTEXPR std::size_t get_value(char16_t c) { + inline SPROUT_CONSTEXPR std::size_t get_value(char16_t c) { return static_cast(c) < sprout::ascii::detail::table_size ? sprout::ascii::detail::table[static_cast(c)] : 0 ; } - SPROUT_CONSTEXPR std::size_t get_value(char32_t c) { + inline SPROUT_CONSTEXPR std::size_t get_value(char32_t c) { return static_cast(c) < sprout::ascii::detail::table_size ? sprout::ascii::detail::table[static_cast(c)] : 0 @@ -180,46 +180,46 @@ namespace sprout { } // namespace detail #define SPROUT_CTYPE_ASCII_DECL(CHAR_TYPE, PREFIX) \ - SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, alnum))(CHAR_TYPE c) { \ + inline SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, alnum))(CHAR_TYPE c) { \ return sprout::ascii::detail::get_value(c) & (sprout::ascii::detail::alpha | sprout::ascii::detail::digit); \ } \ - SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, alpha))(CHAR_TYPE c) { \ + inline SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, alpha))(CHAR_TYPE c) { \ return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::alpha; \ } \ - SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, blank))(CHAR_TYPE c) { \ + inline SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, blank))(CHAR_TYPE c) { \ return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::blank; \ } \ - SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, cntrl))(CHAR_TYPE c) { \ + inline SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, cntrl))(CHAR_TYPE c) { \ return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::cntrl; \ } \ - SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, digit))(CHAR_TYPE c) { \ + inline SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, digit))(CHAR_TYPE c) { \ return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::digit; \ } \ - SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, graph))(CHAR_TYPE c) { \ + inline SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, graph))(CHAR_TYPE c) { \ return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::graph; \ } \ - SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, lower))(CHAR_TYPE c) { \ + inline SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, lower))(CHAR_TYPE c) { \ return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::lower; \ } \ - SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, print))(CHAR_TYPE c) { \ + inline SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, print))(CHAR_TYPE c) { \ return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::print; \ } \ - SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, punct))(CHAR_TYPE c) { \ + inline SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, punct))(CHAR_TYPE c) { \ return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::punct; \ } \ - SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, space))(CHAR_TYPE c) { \ + inline SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, space))(CHAR_TYPE c) { \ return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::space; \ } \ - SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, upper))(CHAR_TYPE c) { \ + inline SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, upper))(CHAR_TYPE c) { \ return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::upper; \ } \ - SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, xdigit))(CHAR_TYPE c) { \ + inline SPROUT_CONSTEXPR bool SPROUT_PP_CAT(is, SPROUT_PP_CAT(PREFIX, xdigit))(CHAR_TYPE c) { \ return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::xdigit; \ } \ - SPROUT_CONSTEXPR CHAR_TYPE SPROUT_PP_CAT(to, SPROUT_PP_CAT(PREFIX, lower))(CHAR_TYPE c) { \ + inline SPROUT_CONSTEXPR CHAR_TYPE SPROUT_PP_CAT(to, SPROUT_PP_CAT(PREFIX, lower))(CHAR_TYPE c) { \ return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::lower ? c + (0x61 - 0x41) : c; \ } \ - SPROUT_CONSTEXPR CHAR_TYPE SPROUT_PP_CAT(to, SPROUT_PP_CAT(PREFIX, upper))(CHAR_TYPE c) { \ + inline SPROUT_CONSTEXPR CHAR_TYPE SPROUT_PP_CAT(to, SPROUT_PP_CAT(PREFIX, upper))(CHAR_TYPE c) { \ return sprout::ascii::detail::get_value(c) & sprout::ascii::detail::upper ? c - (0x61 - 0x41) : c; \ } diff --git a/sprout/darkroom/access/access.hpp b/sprout/darkroom/access/access.hpp index d0afab39..72252416 100644 --- a/sprout/darkroom/access/access.hpp +++ b/sprout/darkroom/access/access.hpp @@ -34,9 +34,8 @@ namespace sprout { // get // template - SPROUT_CONSTEXPR auto get( - T&& t - ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::get(sprout::forward(t)))) + inline SPROUT_CONSTEXPR auto get(T&& t) + SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::get(sprout::forward(t)))) -> decltype(sprout::tuples::get(sprout::forward(t))) { return sprout::tuples::get(sprout::forward(t)); diff --git a/sprout/darkroom/colors/rgb.hpp b/sprout/darkroom/colors/rgb.hpp index f6e00f2d..bfe0e1e8 100644 --- a/sprout/darkroom/colors/rgb.hpp +++ b/sprout/darkroom/colors/rgb.hpp @@ -19,33 +19,29 @@ namespace sprout { // a // template - SPROUT_CONSTEXPR auto r( - T&& t - ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<0>(sprout::forward(t)))) + inline SPROUT_CONSTEXPR auto r(T&& t) + SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<0>(sprout::forward(t)))) -> decltype(sprout::darkroom::access::get<0>(sprout::forward(t))) { return sprout::darkroom::access::get<0>(sprout::forward(t)); } template - SPROUT_CONSTEXPR auto g( - T&& t - ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<1>(sprout::forward(t)))) + inline SPROUT_CONSTEXPR auto g(T&& t) + SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<1>(sprout::forward(t)))) -> decltype(sprout::darkroom::access::get<1>(sprout::forward(t))) { return sprout::darkroom::access::get<1>(sprout::forward(t)); } template - SPROUT_CONSTEXPR auto b( - T&& t - ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<2>(sprout::forward(t)))) + inline SPROUT_CONSTEXPR auto b(T&& t) + SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<2>(sprout::forward(t)))) -> decltype(sprout::darkroom::access::get<2>(sprout::forward(t))) { return sprout::darkroom::access::get<2>(sprout::forward(t)); } template - SPROUT_CONSTEXPR auto a( - T&& t - ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<3>(sprout::forward(t)))) + inline SPROUT_CONSTEXPR auto a(T&& t) + SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<3>(sprout::forward(t)))) -> decltype(sprout::darkroom::access::get<3>(sprout::forward(t))) { return sprout::darkroom::access::get<3>(sprout::forward(t)); diff --git a/sprout/darkroom/coords/vector.hpp b/sprout/darkroom/coords/vector.hpp index c23a9741..0b5c24fb 100644 --- a/sprout/darkroom/coords/vector.hpp +++ b/sprout/darkroom/coords/vector.hpp @@ -17,25 +17,22 @@ namespace sprout { // z // template - SPROUT_CONSTEXPR auto x( - T&& t - ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<0>(sprout::forward(t)))) + inline SPROUT_CONSTEXPR auto x(T&& t) + SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<0>(sprout::forward(t)))) -> decltype(sprout::darkroom::access::get<0>(sprout::forward(t))) { return sprout::darkroom::access::get<0>(sprout::forward(t)); } template - SPROUT_CONSTEXPR auto y( - T&& t - ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<1>(sprout::forward(t)))) + inline SPROUT_CONSTEXPR auto y(T&& t) + SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<1>(sprout::forward(t)))) -> decltype(sprout::darkroom::access::get<1>(sprout::forward(t))) { return sprout::darkroom::access::get<1>(sprout::forward(t)); } template - SPROUT_CONSTEXPR auto z( - T&& t - ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<2>(sprout::forward(t)))) + inline SPROUT_CONSTEXPR auto z(T&& t) + SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<2>(sprout::forward(t)))) -> decltype(sprout::darkroom::access::get<2>(sprout::forward(t))) { return sprout::darkroom::access::get<2>(sprout::forward(t)); @@ -179,7 +176,7 @@ namespace sprout { // normal_to_color // template - SPROUT_CONSTEXPR Color normal_to_color(Normal const& nor) { + inline SPROUT_CONSTEXPR Color normal_to_color(Normal const& nor) { return sprout::tuples::make( 0.5 + sprout::darkroom::coords::x(nor) * 0.5, 0.5 + sprout::darkroom::coords::y(nor) * 0.5, diff --git a/sprout/darkroom/intersects/intersection.hpp b/sprout/darkroom/intersects/intersection.hpp index 5942f138..af02dbb4 100644 --- a/sprout/darkroom/intersects/intersection.hpp +++ b/sprout/darkroom/intersects/intersection.hpp @@ -19,41 +19,36 @@ namespace sprout { // material // template - SPROUT_CONSTEXPR auto does_intersect( - T&& t - ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<0>(sprout::forward(t)))) + inline SPROUT_CONSTEXPR auto does_intersect(T&& t) + SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<0>(sprout::forward(t)))) -> decltype(sprout::darkroom::access::get<0>(sprout::forward(t))) { return sprout::darkroom::access::get<0>(sprout::forward(t)); } template - SPROUT_CONSTEXPR auto distance( - T&& t - ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<1>(sprout::forward(t)))) + inline SPROUT_CONSTEXPR auto distance(T&& t) + SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<1>(sprout::forward(t)))) -> decltype(sprout::darkroom::access::get<1>(sprout::forward(t))) { return sprout::darkroom::access::get<1>(sprout::forward(t)); } template - SPROUT_CONSTEXPR auto point_of_intersection( - T&& t - ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<2>(sprout::forward(t)))) + inline SPROUT_CONSTEXPR auto point_of_intersection(T&& t) + SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<2>(sprout::forward(t)))) -> decltype(sprout::darkroom::access::get<2>(sprout::forward(t))) { return sprout::darkroom::access::get<2>(sprout::forward(t)); } template - SPROUT_CONSTEXPR auto normal( - T&& t - ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<3>(sprout::forward(t)))) + inline SPROUT_CONSTEXPR auto normal(T&& t) + SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<3>(sprout::forward(t)))) -> decltype(sprout::darkroom::access::get<3>(sprout::forward(t))) { return sprout::darkroom::access::get<3>(sprout::forward(t)); } template - SPROUT_CONSTEXPR auto material( - T&& t - ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<4>(sprout::forward(t)))) + inline SPROUT_CONSTEXPR auto material(T&& t) + SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<4>(sprout::forward(t)))) -> decltype(sprout::darkroom::access::get<4>(sprout::forward(t))) { return sprout::darkroom::access::get<4>(sprout::forward(t)); @@ -63,7 +58,7 @@ namespace sprout { // make_intersection // template - SPROUT_CONSTEXPR sprout::tuples::tuple + inline SPROUT_CONSTEXPR sprout::tuples::tuple make_intersection(bool b, Distance const& dist, Point const& p, Normal const& nor, Material const& mat) { return sprout::tuples::make_tuple(b, dist, p, nor, mat); } diff --git a/sprout/darkroom/materials/material.hpp b/sprout/darkroom/materials/material.hpp index 05b703a1..f9080936 100644 --- a/sprout/darkroom/materials/material.hpp +++ b/sprout/darkroom/materials/material.hpp @@ -15,17 +15,15 @@ namespace sprout { // reflection // template - SPROUT_CONSTEXPR auto color( - T&& t - ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<0>(sprout::forward(t)))) + inline SPROUT_CONSTEXPR auto color(T&& t) + SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<0>(sprout::forward(t)))) -> decltype(sprout::darkroom::access::get<0>(sprout::forward(t))) { return sprout::darkroom::access::get<0>(sprout::forward(t)); } template - SPROUT_CONSTEXPR auto reflection( - T&& t - ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<1>(sprout::forward(t)))) + inline SPROUT_CONSTEXPR auto reflection(T&& t) + SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<1>(sprout::forward(t)))) -> decltype(sprout::darkroom::access::get<1>(sprout::forward(t))) { return sprout::darkroom::access::get<1>(sprout::forward(t)); @@ -36,13 +34,13 @@ namespace sprout { // calc_reflection // template - SPROUT_CONSTEXPR auto calc_color(Image&& t, Unit const& u, Unit const& v) SPROUT_NOEXCEPT + inline SPROUT_CONSTEXPR auto calc_color(Image&& t, Unit const& u, Unit const& v) SPROUT_NOEXCEPT -> decltype(sprout::forward(t).template operator()(u, v)) { return sprout::forward(t).template operator()(u, v); } template - SPROUT_CONSTEXPR auto calc_reflection(Image&& t, Unit const& u, Unit const& v) SPROUT_NOEXCEPT + inline SPROUT_CONSTEXPR auto calc_reflection(Image&& t, Unit const& u, Unit const& v) SPROUT_NOEXCEPT -> decltype(sprout::forward(t).template operator()(u, v)) { return sprout::forward(t).template operator()(u, v); @@ -52,7 +50,7 @@ namespace sprout { // calc_material // template - SPROUT_CONSTEXPR auto calc_material(Material const& mat, Unit const& u, Unit const& v) + inline SPROUT_CONSTEXPR auto calc_material(Material const& mat, Unit const& u, Unit const& v) -> decltype(sprout::tuples::make_tuple( sprout::darkroom::materials::calc_color(sprout::darkroom::materials::color(mat), u, v), sprout::darkroom::materials::calc_reflection(sprout::darkroom::materials::reflection(mat), u, v) @@ -68,7 +66,7 @@ namespace sprout { // make_material_image // template - SPROUT_CONSTEXPR sprout::tuples::tuple + inline SPROUT_CONSTEXPR sprout::tuples::tuple make_material_image(ColorImage const& col, ReflectionImage const& ref) { return sprout::tuples::make_tuple(col, ref); } diff --git a/sprout/darkroom/materials/plaid.hpp b/sprout/darkroom/materials/plaid.hpp index 5e1d170c..208c490e 100644 --- a/sprout/darkroom/materials/plaid.hpp +++ b/sprout/darkroom/materials/plaid.hpp @@ -63,12 +63,12 @@ namespace sprout { // make_plaid // template - SPROUT_CONSTEXPR sprout::darkroom::materials::plaid_element + inline SPROUT_CONSTEXPR sprout::darkroom::materials::plaid_element make_plaid(Element const& elem1, Element const& elem2) { return sprout::darkroom::materials::plaid_element(elem1, elem2); } template - SPROUT_CONSTEXPR sprout::darkroom::materials::plaid_element + inline SPROUT_CONSTEXPR sprout::darkroom::materials::plaid_element make_plaid(Element const& elem1, Element const& elem2, Unit const& scale) { return sprout::darkroom::materials::plaid_element(elem1, elem2, scale); } @@ -76,7 +76,7 @@ namespace sprout { // make_plaid_material_image // template - SPROUT_CONSTEXPR sprout::tuples::tuple< + inline SPROUT_CONSTEXPR sprout::tuples::tuple< sprout::darkroom::materials::plaid_element, sprout::darkroom::materials::plaid_element > make_plaid_material_image( @@ -92,7 +92,7 @@ namespace sprout { ); } template - SPROUT_CONSTEXPR sprout::tuples::tuple< + inline SPROUT_CONSTEXPR sprout::tuples::tuple< sprout::darkroom::materials::plaid_element, sprout::darkroom::materials::plaid_element > make_plaid_material_image( diff --git a/sprout/darkroom/materials/texture_map.hpp b/sprout/darkroom/materials/texture_map.hpp index b3770b6b..48a205a0 100644 --- a/sprout/darkroom/materials/texture_map.hpp +++ b/sprout/darkroom/materials/texture_map.hpp @@ -162,12 +162,12 @@ namespace sprout { // make_texture_map // template - SPROUT_CONSTEXPR sprout::darkroom::materials::texture_map + inline SPROUT_CONSTEXPR sprout::darkroom::materials::texture_map make_texture_map(Texture const& texture) { return sprout::darkroom::materials::texture_map(texture); } template - SPROUT_CONSTEXPR sprout::darkroom::materials::texture_map + inline SPROUT_CONSTEXPR sprout::darkroom::materials::texture_map make_texture_map( Texture const& texture, Unit const& scale, diff --git a/sprout/darkroom/materials/uniform.hpp b/sprout/darkroom/materials/uniform.hpp index 9fb83bab..b9dfc2b5 100644 --- a/sprout/darkroom/materials/uniform.hpp +++ b/sprout/darkroom/materials/uniform.hpp @@ -29,7 +29,7 @@ namespace sprout { // make_uniform // template - SPROUT_CONSTEXPR sprout::darkroom::materials::uniform_element + inline SPROUT_CONSTEXPR sprout::darkroom::materials::uniform_element make_uniform(Element const& elem) { return sprout::darkroom::materials::uniform_element(elem); } @@ -37,7 +37,7 @@ namespace sprout { // make_uniform_material_image // template - SPROUT_CONSTEXPR sprout::tuples::tuple< + inline SPROUT_CONSTEXPR sprout::tuples::tuple< sprout::darkroom::materials::uniform_element, sprout::darkroom::materials::uniform_element > make_uniform_material_image(Color const& col, Reflection const& ref) { diff --git a/sprout/darkroom/rays/ray.hpp b/sprout/darkroom/rays/ray.hpp index e466a882..ad7f0956 100644 --- a/sprout/darkroom/rays/ray.hpp +++ b/sprout/darkroom/rays/ray.hpp @@ -15,17 +15,15 @@ namespace sprout { // direction // template - SPROUT_CONSTEXPR auto position( - T&& t - ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<0>(sprout::forward(t)))) + inline SPROUT_CONSTEXPR auto position(T&& t) + SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<0>(sprout::forward(t)))) -> decltype(sprout::darkroom::access::get<0>(sprout::forward(t))) { return sprout::darkroom::access::get<0>(sprout::forward(t)); } template - SPROUT_CONSTEXPR auto direction( - T&& t - ) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<1>(sprout::forward(t)))) + inline SPROUT_CONSTEXPR auto direction(T&& t) + SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::darkroom::access::get<1>(sprout::forward(t)))) -> decltype(sprout::darkroom::access::get<1>(sprout::forward(t))) { return sprout::darkroom::access::get<1>(sprout::forward(t)); @@ -35,7 +33,7 @@ namespace sprout { // make_ray // template - SPROUT_CONSTEXPR sprout::tuples::tuple + inline SPROUT_CONSTEXPR sprout::tuples::tuple make_ray(Position const& pos, Direction const& dir) { return sprout::tuples::make_tuple(pos, dir); } diff --git a/sprout/detail/algorithm/count_n.hpp b/sprout/detail/algorithm/count_n.hpp index 13cd3a29..57b893c7 100644 --- a/sprout/detail/algorithm/count_n.hpp +++ b/sprout/detail/algorithm/count_n.hpp @@ -11,7 +11,7 @@ namespace sprout { // count_n // template - SPROUT_CONSTEXPR typename std::iterator_traits::difference_type count_n( + inline SPROUT_CONSTEXPR typename std::iterator_traits::difference_type count_n( InputIterator first, Size n, T const& value diff --git a/sprout/detail/algorithm/count_n_if.hpp b/sprout/detail/algorithm/count_n_if.hpp index 54071879..53b9f50a 100644 --- a/sprout/detail/algorithm/count_n_if.hpp +++ b/sprout/detail/algorithm/count_n_if.hpp @@ -11,7 +11,7 @@ namespace sprout { // count_n_if // template - SPROUT_CONSTEXPR typename std::iterator_traits::difference_type count_n_if( + inline SPROUT_CONSTEXPR typename std::iterator_traits::difference_type count_n_if( InputIterator first, Size n, Predicate pred diff --git a/sprout/functional/bind1st.hpp b/sprout/functional/bind1st.hpp index 2669743a..c2954649 100644 --- a/sprout/functional/bind1st.hpp +++ b/sprout/functional/bind1st.hpp @@ -26,7 +26,7 @@ namespace sprout { // D.9.2 bind1st template - SPROUT_CONSTEXPR sprout::binder1st bind1st(Fn const& fn, T const& x) { + inline SPROUT_CONSTEXPR sprout::binder1st bind1st(Fn const& fn, T const& x) { return sprout::binder1st(fn, typename Fn::first_argument_type(x)); } } // namespace sprout diff --git a/sprout/functional/bind2nd.hpp b/sprout/functional/bind2nd.hpp index 6f9c29ce..ff682b91 100644 --- a/sprout/functional/bind2nd.hpp +++ b/sprout/functional/bind2nd.hpp @@ -26,7 +26,7 @@ namespace sprout { // D.9.4 bind2nd template - SPROUT_CONSTEXPR sprout::binder2nd bind2nd(Fn const& op, T const& x) { + inline SPROUT_CONSTEXPR sprout::binder2nd bind2nd(Fn const& op, T const& x) { return sprout::binder2nd(op, typename Fn::second_argument_type(x)); } } // namespace sprout diff --git a/sprout/functional/hash/hash.hpp b/sprout/functional/hash/hash.hpp index 0fa76763..9d55d6f5 100644 --- a/sprout/functional/hash/hash.hpp +++ b/sprout/functional/hash/hash.hpp @@ -41,7 +41,7 @@ namespace sprout { namespace hash_detail { template - SPROUT_CONSTEXPR std::size_t hash_value_signed_2(T val, int length, std::size_t seed, T positive, std::size_t i) { + inline SPROUT_CONSTEXPR std::size_t hash_value_signed_2(T val, int length, std::size_t seed, T positive, std::size_t i) { return i > 0 ? hash_value_signed_2( val, @@ -54,11 +54,11 @@ namespace sprout { ; } template - SPROUT_CONSTEXPR std::size_t hash_value_signed_1(T val, int length, std::size_t seed, T positive) { + inline SPROUT_CONSTEXPR std::size_t hash_value_signed_1(T val, int length, std::size_t seed, T positive) { return hash_value_signed_2(val, length, seed, positive, length * std::numeric_limits::digits); } template - SPROUT_CONSTEXPR std::size_t hash_value_signed(T val) { + inline SPROUT_CONSTEXPR std::size_t hash_value_signed(T val) { return sprout::hash_detail::hash_value_signed_1( val, (std::numeric_limits::digits - 1) / std::numeric_limits::digits, @@ -68,7 +68,7 @@ namespace sprout { } template - SPROUT_CONSTEXPR std::size_t hash_value_unsigned_2(T val, int length, std::size_t seed, std::size_t i) { + inline SPROUT_CONSTEXPR std::size_t hash_value_unsigned_2(T val, int length, std::size_t seed, std::size_t i) { return i > 0 ? hash_value_unsigned_2( val, @@ -80,11 +80,11 @@ namespace sprout { ; } template - SPROUT_CONSTEXPR std::size_t hash_value_unsigned_1(T val, int length, std::size_t seed) { + inline SPROUT_CONSTEXPR std::size_t hash_value_unsigned_1(T val, int length, std::size_t seed) { return hash_value_unsigned_2(val, length, seed, length * std::numeric_limits::digits); } template - SPROUT_CONSTEXPR std::size_t hash_value_unsigned(T val) { + inline SPROUT_CONSTEXPR std::size_t hash_value_unsigned(T val) { return sprout::hash_detail::hash_value_unsigned_1( val, (std::numeric_limits::digits - 1) / std::numeric_limits::digits, diff --git a/sprout/functional/hash/sscrisk/cel/array.hpp b/sprout/functional/hash/sscrisk/cel/array.hpp index 9c5aef11..b58d63de 100644 --- a/sprout/functional/hash/sscrisk/cel/array.hpp +++ b/sprout/functional/hash/sscrisk/cel/array.hpp @@ -8,7 +8,7 @@ namespace sprout { template - SPROUT_CONSTEXPR std::size_t hash_value(sscrisk::cel::array const& v) { + inline SPROUT_CONSTEXPR std::size_t hash_value(sscrisk::cel::array const& v) { return sprout::hash_range(v.begin(), v.end()); } } // namespace sprout diff --git a/sprout/functional/hash/sscrisk/cel/utility.hpp b/sprout/functional/hash/sscrisk/cel/utility.hpp index d1d206ed..ffd98fdc 100644 --- a/sprout/functional/hash/sscrisk/cel/utility.hpp +++ b/sprout/functional/hash/sscrisk/cel/utility.hpp @@ -8,7 +8,7 @@ namespace sprout { template - SPROUT_CONSTEXPR std::size_t hash_value(sscrisk::cel::pair const& v) { + inline SPROUT_CONSTEXPR std::size_t hash_value(sscrisk::cel::pair const& v) { return sprout::hash_combine(sprout::hash_combine(0, v.first), v.second); } } // namespace sprout diff --git a/sprout/functional/polymorphic/bind1st.hpp b/sprout/functional/polymorphic/bind1st.hpp index ae97fffe..5af1087f 100644 --- a/sprout/functional/polymorphic/bind1st.hpp +++ b/sprout/functional/polymorphic/bind1st.hpp @@ -29,7 +29,7 @@ namespace sprout { } }; template - SPROUT_CONSTEXPR sprout::binder1st_::type, typename std::decay::type> + inline SPROUT_CONSTEXPR sprout::binder1st_::type, typename std::decay::type> bind1st_(Fn&& fn, T&& x) { typedef sprout::binder1st_::type, typename std::decay::type> type; return type(sprout::forward(fn), sprout::forward(x)); diff --git a/sprout/functional/polymorphic/bind2nd.hpp b/sprout/functional/polymorphic/bind2nd.hpp index d08ac009..f45603a2 100644 --- a/sprout/functional/polymorphic/bind2nd.hpp +++ b/sprout/functional/polymorphic/bind2nd.hpp @@ -29,7 +29,7 @@ namespace sprout { } }; template - SPROUT_CONSTEXPR sprout::binder2nd_::type, typename std::decay::type> + inline SPROUT_CONSTEXPR sprout::binder2nd_::type, typename std::decay::type> bind2nd_(Fn&& fn, T&& x) { typedef sprout::binder2nd_::type, typename std::decay::type> type; return type(sprout::forward(fn), sprout::forward(x)); diff --git a/sprout/integer/bit_length.hpp b/sprout/integer/bit_length.hpp index 87d95644..6b7e3bf1 100644 --- a/sprout/integer/bit_length.hpp +++ b/sprout/integer/bit_length.hpp @@ -59,7 +59,7 @@ namespace sprout { // bit_length // template - SPROUT_CONSTEXPR typename std::enable_if< + inline SPROUT_CONSTEXPR typename std::enable_if< std::is_integral::value, IntType >::type bit_length(IntType x) { diff --git a/sprout/integer/bit_reverse.hpp b/sprout/integer/bit_reverse.hpp index 00cc0450..522b3c86 100644 --- a/sprout/integer/bit_reverse.hpp +++ b/sprout/integer/bit_reverse.hpp @@ -63,7 +63,7 @@ namespace sprout { // bit_reverse_in // template - SPROUT_CONSTEXPR typename std::enable_if< + inline SPROUT_CONSTEXPR typename std::enable_if< std::is_integral::value, IntType >::type bit_reverse_in(IntType x, std::size_t length) { diff --git a/sprout/iterator/bytes_iterator.hpp b/sprout/iterator/bytes_iterator.hpp index 62e37b1c..4fcaf506 100644 --- a/sprout/iterator/bytes_iterator.hpp +++ b/sprout/iterator/bytes_iterator.hpp @@ -212,7 +212,7 @@ namespace sprout { // distance // template - SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type + inline SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type distance( sprout::bytes_iterator first, sprout::bytes_iterator last diff --git a/sprout/iterator/counting_iterator.hpp b/sprout/iterator/counting_iterator.hpp index dbde1e97..f148fe35 100644 --- a/sprout/iterator/counting_iterator.hpp +++ b/sprout/iterator/counting_iterator.hpp @@ -184,7 +184,7 @@ namespace sprout { // swap // template - void swap(sprout::counting_iterator& lhs, sprout::counting_iterator& rhs) + inline void swap(sprout::counting_iterator& lhs, sprout::counting_iterator& rhs) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) { lhs.swap(rhs); @@ -194,14 +194,14 @@ namespace sprout { // next // template - SPROUT_CONSTEXPR sprout::counting_iterator next( + inline SPROUT_CONSTEXPR sprout::counting_iterator next( sprout::counting_iterator const& it ) { return it.next(); } template - SPROUT_CONSTEXPR sprout::counting_iterator next( + inline SPROUT_CONSTEXPR sprout::counting_iterator next( sprout::counting_iterator const& it, typename sprout::counting_iterator::difference_type n ) @@ -213,14 +213,14 @@ namespace sprout { // prev // template - SPROUT_CONSTEXPR sprout::counting_iterator prev( + inline SPROUT_CONSTEXPR sprout::counting_iterator prev( sprout::counting_iterator const& it ) { return it.prev(); } template - SPROUT_CONSTEXPR sprout::counting_iterator prev( + inline SPROUT_CONSTEXPR sprout::counting_iterator prev( sprout::counting_iterator const& it, typename sprout::counting_iterator::difference_type n ) @@ -232,7 +232,7 @@ namespace sprout { // distance // template - SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type + inline SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type distance( sprout::counting_iterator first, sprout::counting_iterator last diff --git a/sprout/iterator/distance.hpp b/sprout/iterator/distance.hpp index 1eb79140..88029efd 100644 --- a/sprout/iterator/distance.hpp +++ b/sprout/iterator/distance.hpp @@ -10,14 +10,14 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) template - SPROUT_CONSTEXPR typename std::iterator_traits::difference_type + inline SPROUT_CONSTEXPR typename std::iterator_traits::difference_type distance(InputIterator first, InputIterator last) { return first == last ? 0 : 1 + sprout::detail::distance(sprout::next(first), last) ; } template - SPROUT_CONSTEXPR typename std::iterator_traits::difference_type + inline SPROUT_CONSTEXPR typename std::iterator_traits::difference_type distance_impl(InputIterator first, InputIterator last) { using sprout::detail::distance; return distance(first, last); @@ -27,7 +27,7 @@ namespace sprout { // distance // template - SPROUT_CONSTEXPR typename std::iterator_traits::difference_type + inline SPROUT_CONSTEXPR typename std::iterator_traits::difference_type distance(InputIterator first, InputIterator last) { return sprout::detail::distance_impl(first, last); } diff --git a/sprout/iterator/index_iterator.hpp b/sprout/iterator/index_iterator.hpp index 594a49eb..8926377b 100644 --- a/sprout/iterator/index_iterator.hpp +++ b/sprout/iterator/index_iterator.hpp @@ -171,7 +171,7 @@ namespace sprout { // swap // template - void swap(sprout::index_iterator& lhs, sprout::index_iterator& rhs) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) { + inline void swap(sprout::index_iterator& lhs, sprout::index_iterator& rhs) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) { lhs.swap(rhs); } @@ -199,14 +199,14 @@ namespace sprout { // next // template - SPROUT_CONSTEXPR sprout::index_iterator next( + inline SPROUT_CONSTEXPR sprout::index_iterator next( sprout::index_iterator const& it ) { return it.next(); } template - SPROUT_CONSTEXPR sprout::index_iterator next( + inline SPROUT_CONSTEXPR sprout::index_iterator next( sprout::index_iterator const& it, typename sprout::index_iterator::difference_type n ) @@ -218,14 +218,14 @@ namespace sprout { // prev // template - SPROUT_CONSTEXPR sprout::index_iterator prev( + inline SPROUT_CONSTEXPR sprout::index_iterator prev( sprout::index_iterator const& it ) { return it.prev(); } template - SPROUT_CONSTEXPR sprout::index_iterator prev( + inline SPROUT_CONSTEXPR sprout::index_iterator prev( sprout::index_iterator const& it, typename sprout::index_iterator::difference_type n ) @@ -237,7 +237,7 @@ namespace sprout { // distance // template - SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type + inline SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type distance( sprout::index_iterator first, sprout::index_iterator last diff --git a/sprout/iterator/next.hpp b/sprout/iterator/next.hpp index c4b72d10..5f42f8da 100644 --- a/sprout/iterator/next.hpp +++ b/sprout/iterator/next.hpp @@ -9,7 +9,7 @@ namespace sprout { namespace detail { template - SPROUT_CONSTEXPR typename std::enable_if< + inline SPROUT_CONSTEXPR typename std::enable_if< std::is_literal_type::type>::value, typename std::decay::type >::type next_impl( @@ -20,7 +20,7 @@ namespace sprout { return sprout::forward(it) + 1; } template - SPROUT_CONSTEXPR typename std::decay::type next_impl( + inline SPROUT_CONSTEXPR typename std::decay::type next_impl( ForwardIterator&& it, void* ) @@ -29,7 +29,7 @@ namespace sprout { } template - SPROUT_CONSTEXPR typename std::enable_if< + inline SPROUT_CONSTEXPR typename std::enable_if< std::is_literal_type::type>::value, typename std::decay::type >::type next_impl( @@ -41,7 +41,7 @@ namespace sprout { return sprout::forward(it) + n; } template - SPROUT_CONSTEXPR typename std::decay::type next_impl( + inline SPROUT_CONSTEXPR typename std::decay::type next_impl( ForwardIterator it, typename std::iterator_traits::type>::difference_type n, void* @@ -54,7 +54,8 @@ namespace sprout { // next // template - SPROUT_CONSTEXPR typename std::decay::type next(ForwardIterator&& it) { + inline SPROUT_CONSTEXPR typename std::decay::type + next(ForwardIterator&& it) { typedef typename std::iterator_traits::type>::iterator_category* category; return sprout::detail::next_impl( sprout::forward(it), @@ -62,11 +63,8 @@ namespace sprout { ); } template - SPROUT_CONSTEXPR typename std::decay::type next( - ForwardIterator&& it, - typename std::iterator_traits::type>::difference_type n - ) - { + inline SPROUT_CONSTEXPR typename std::decay::type + next(ForwardIterator&& it, typename std::iterator_traits::type>::difference_type n) { typedef typename std::iterator_traits::type>::iterator_category* category; return sprout::detail::next_impl( sprout::forward(it), diff --git a/sprout/iterator/prev.hpp b/sprout/iterator/prev.hpp index f265fa0d..f371045d 100644 --- a/sprout/iterator/prev.hpp +++ b/sprout/iterator/prev.hpp @@ -9,7 +9,7 @@ namespace sprout { namespace detail { template - SPROUT_CONSTEXPR typename std::enable_if< + inline SPROUT_CONSTEXPR typename std::enable_if< std::is_literal_type::type>::value, typename std::decay::type >::type prev_impl( @@ -20,7 +20,7 @@ namespace sprout { return sprout::forward(it) - 1; } template - SPROUT_CONSTEXPR typename std::decay::type prev_impl( + inline SPROUT_CONSTEXPR typename std::decay::type prev_impl( BidirectionalIterator&& it, void* ) @@ -29,7 +29,7 @@ namespace sprout { } template - SPROUT_CONSTEXPR typename std::enable_if< + inline SPROUT_CONSTEXPR typename std::enable_if< std::is_literal_type::type>::value, typename std::decay::type >::type prev_impl( @@ -41,7 +41,7 @@ namespace sprout { return sprout::forward(it) - n; } template - SPROUT_CONSTEXPR typename std::decay::type prev_impl( + inline SPROUT_CONSTEXPR typename std::decay::type prev_impl( BidirectionalIterator it, typename std::iterator_traits::type>::difference_type n, void* @@ -54,7 +54,8 @@ namespace sprout { // prev // template - SPROUT_CONSTEXPR typename std::decay::type prev(BidirectionalIterator&& it) { + inline SPROUT_CONSTEXPR typename std::decay::type + prev(BidirectionalIterator&& it) { typedef typename std::iterator_traits::type>::iterator_category* category; return sprout::detail::prev_impl( sprout::forward(it), @@ -62,11 +63,8 @@ namespace sprout { ); } template - SPROUT_CONSTEXPR typename std::decay::type prev( - BidirectionalIterator&& it, - typename std::iterator_traits::type>::difference_type n - ) - { + inline SPROUT_CONSTEXPR typename std::decay::type + prev(BidirectionalIterator&& it, typename std::iterator_traits::type>::difference_type n) { typedef typename std::iterator_traits::type>::iterator_category* category; return sprout::detail::prev_impl( sprout::forward(it), diff --git a/sprout/iterator/reverse_iterator.hpp b/sprout/iterator/reverse_iterator.hpp index ba629dd7..a0f44bf8 100644 --- a/sprout/iterator/reverse_iterator.hpp +++ b/sprout/iterator/reverse_iterator.hpp @@ -120,7 +120,7 @@ namespace sprout { }; template - SPROUT_CONSTEXPR bool operator==( + inline SPROUT_CONSTEXPR bool operator==( sprout::reverse_iterator const& lhs, sprout::reverse_iterator const& rhs ) @@ -128,7 +128,7 @@ namespace sprout { return lhs.base() == rhs.base(); } template - SPROUT_CONSTEXPR bool operator!=( + inline SPROUT_CONSTEXPR bool operator!=( sprout::reverse_iterator const& lhs, sprout::reverse_iterator const& rhs ) @@ -136,7 +136,7 @@ namespace sprout { return !(lhs == rhs); } template - SPROUT_CONSTEXPR bool operator<( + inline SPROUT_CONSTEXPR bool operator<( sprout::reverse_iterator const& lhs, sprout::reverse_iterator const& rhs ) @@ -144,7 +144,7 @@ namespace sprout { return lhs.base() < rhs.base(); } template - SPROUT_CONSTEXPR bool operator>( + inline SPROUT_CONSTEXPR bool operator>( sprout::reverse_iterator const& lhs, sprout::reverse_iterator const& rhs ) @@ -152,7 +152,7 @@ namespace sprout { return rhs < lhs; } template - SPROUT_CONSTEXPR bool operator<=( + inline SPROUT_CONSTEXPR bool operator<=( sprout::reverse_iterator const& lhs, sprout::reverse_iterator const& rhs ) @@ -160,7 +160,7 @@ namespace sprout { return !(rhs < lhs); } template - SPROUT_CONSTEXPR bool operator>=( + inline SPROUT_CONSTEXPR bool operator>=( sprout::reverse_iterator const& lhs, sprout::reverse_iterator const& rhs ) @@ -168,7 +168,7 @@ namespace sprout { return !(lhs < rhs); } template - SPROUT_CONSTEXPR decltype(std::declval() - std::declval()) operator-( + inline SPROUT_CONSTEXPR decltype(std::declval() - std::declval()) operator-( sprout::reverse_iterator const& lhs, sprout::reverse_iterator const& rhs ) @@ -176,7 +176,7 @@ namespace sprout { return lhs.base() - rhs.base(); } template - SPROUT_CONSTEXPR sprout::reverse_iterator operator+( + inline SPROUT_CONSTEXPR sprout::reverse_iterator operator+( typename sprout::reverse_iterator::difference_type n, sprout::reverse_iterator const& it ) @@ -188,7 +188,7 @@ namespace sprout { // swap // template - void swap(sprout::reverse_iterator& lhs, sprout::reverse_iterator& rhs) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) { + inline void swap(sprout::reverse_iterator& lhs, sprout::reverse_iterator& rhs) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) { lhs.swap(rhs); } @@ -196,14 +196,14 @@ namespace sprout { // next // template - SPROUT_CONSTEXPR sprout::reverse_iterator next( + inline SPROUT_CONSTEXPR sprout::reverse_iterator next( sprout::reverse_iterator const& it ) { return it.next(); } template - SPROUT_CONSTEXPR sprout::reverse_iterator next( + inline SPROUT_CONSTEXPR sprout::reverse_iterator next( sprout::reverse_iterator const& it, typename sprout::reverse_iterator::difference_type n ) @@ -215,14 +215,14 @@ namespace sprout { // prev // template - SPROUT_CONSTEXPR sprout::reverse_iterator prev( + inline SPROUT_CONSTEXPR sprout::reverse_iterator prev( sprout::reverse_iterator const& it ) { return it.prev(); } template - SPROUT_CONSTEXPR sprout::reverse_iterator prev( + inline SPROUT_CONSTEXPR sprout::reverse_iterator prev( sprout::reverse_iterator const& it, typename sprout::reverse_iterator::difference_type n ) @@ -234,7 +234,7 @@ namespace sprout { // distance // template - SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type + inline SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type distance( sprout::reverse_iterator first, sprout::reverse_iterator last diff --git a/sprout/iterator/sawtooth_iterator.hpp b/sprout/iterator/sawtooth_iterator.hpp index 6b1887b9..0f3c0db2 100644 --- a/sprout/iterator/sawtooth_iterator.hpp +++ b/sprout/iterator/sawtooth_iterator.hpp @@ -146,7 +146,7 @@ namespace sprout { }; template - SPROUT_CONSTEXPR bool operator==( + inline SPROUT_CONSTEXPR bool operator==( sprout::sawtooth_iterator const& lhs, sprout::sawtooth_iterator const& rhs ) @@ -154,7 +154,7 @@ namespace sprout { return lhs.index() == rhs.index(); } template - SPROUT_CONSTEXPR bool operator!=( + inline SPROUT_CONSTEXPR bool operator!=( sprout::sawtooth_iterator const& lhs, sprout::sawtooth_iterator const& rhs ) @@ -162,7 +162,7 @@ namespace sprout { return !(lhs == rhs); } template - SPROUT_CONSTEXPR bool operator<( + inline SPROUT_CONSTEXPR bool operator<( sprout::sawtooth_iterator const& lhs, sprout::sawtooth_iterator const& rhs ) @@ -170,7 +170,7 @@ namespace sprout { return lhs.index() < rhs.index(); } template - SPROUT_CONSTEXPR bool operator>( + inline SPROUT_CONSTEXPR bool operator>( sprout::sawtooth_iterator const& lhs, sprout::sawtooth_iterator const& rhs ) @@ -178,7 +178,7 @@ namespace sprout { return rhs < lhs; } template - SPROUT_CONSTEXPR bool operator<=( + inline SPROUT_CONSTEXPR bool operator<=( sprout::sawtooth_iterator const& lhs, sprout::sawtooth_iterator const& rhs ) @@ -186,7 +186,7 @@ namespace sprout { return !(rhs < lhs); } template - SPROUT_CONSTEXPR bool operator>=( + inline SPROUT_CONSTEXPR bool operator>=( sprout::sawtooth_iterator const& lhs, sprout::sawtooth_iterator const& rhs ) @@ -194,7 +194,7 @@ namespace sprout { return !(lhs < rhs); } template - SPROUT_CONSTEXPR typename sprout::sawtooth_iterator::difference_type operator-( + inline SPROUT_CONSTEXPR typename sprout::sawtooth_iterator::difference_type operator-( sprout::sawtooth_iterator const& lhs, sprout::sawtooth_iterator const& rhs ) @@ -202,7 +202,7 @@ namespace sprout { return lhs.index() - rhs.index(); } template - SPROUT_CONSTEXPR sprout::sawtooth_iterator operator+( + inline SPROUT_CONSTEXPR sprout::sawtooth_iterator operator+( typename sprout::sawtooth_iterator::difference_type n, sprout::sawtooth_iterator const& it ) @@ -214,7 +214,7 @@ namespace sprout { // swap // template - void swap(sprout::sawtooth_iterator& lhs, sprout::sawtooth_iterator& rhs) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) { + inline void swap(sprout::sawtooth_iterator& lhs, sprout::sawtooth_iterator& rhs) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) { lhs.swap(rhs); } @@ -222,14 +222,14 @@ namespace sprout { // next // template - SPROUT_CONSTEXPR sprout::sawtooth_iterator next( + inline SPROUT_CONSTEXPR sprout::sawtooth_iterator next( sprout::sawtooth_iterator const& it ) { return it.next(); } template - SPROUT_CONSTEXPR sprout::sawtooth_iterator next( + inline SPROUT_CONSTEXPR sprout::sawtooth_iterator next( sprout::sawtooth_iterator const& it, typename sprout::sawtooth_iterator::difference_type n ) @@ -241,14 +241,14 @@ namespace sprout { // prev // template - SPROUT_CONSTEXPR sprout::sawtooth_iterator prev( + inline SPROUT_CONSTEXPR sprout::sawtooth_iterator prev( sprout::sawtooth_iterator const& it ) { return it.prev(); } template - SPROUT_CONSTEXPR sprout::sawtooth_iterator prev( + inline SPROUT_CONSTEXPR sprout::sawtooth_iterator prev( sprout::sawtooth_iterator const& it, typename sprout::sawtooth_iterator::difference_type n ) @@ -260,7 +260,7 @@ namespace sprout { // distance // template - SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type + inline SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type distance( sprout::sawtooth_iterator first, sprout::sawtooth_iterator last diff --git a/sprout/iterator/sinusoid_iterator.hpp b/sprout/iterator/sinusoid_iterator.hpp index ba8066ac..9fb4f397 100644 --- a/sprout/iterator/sinusoid_iterator.hpp +++ b/sprout/iterator/sinusoid_iterator.hpp @@ -155,7 +155,7 @@ namespace sprout { }; template - SPROUT_CONSTEXPR bool operator==( + inline SPROUT_CONSTEXPR bool operator==( sprout::sinusoid_iterator const& lhs, sprout::sinusoid_iterator const& rhs ) @@ -163,7 +163,7 @@ namespace sprout { return lhs.index() == rhs.index(); } template - SPROUT_CONSTEXPR bool operator!=( + inline SPROUT_CONSTEXPR bool operator!=( sprout::sinusoid_iterator const& lhs, sprout::sinusoid_iterator const& rhs ) @@ -171,7 +171,7 @@ namespace sprout { return !(lhs == rhs); } template - SPROUT_CONSTEXPR bool operator<( + inline SPROUT_CONSTEXPR bool operator<( sprout::sinusoid_iterator const& lhs, sprout::sinusoid_iterator const& rhs ) @@ -179,7 +179,7 @@ namespace sprout { return lhs.index() < rhs.index(); } template - SPROUT_CONSTEXPR bool operator>( + inline SPROUT_CONSTEXPR bool operator>( sprout::sinusoid_iterator const& lhs, sprout::sinusoid_iterator const& rhs ) @@ -187,7 +187,7 @@ namespace sprout { return rhs < lhs; } template - SPROUT_CONSTEXPR bool operator<=( + inline SPROUT_CONSTEXPR bool operator<=( sprout::sinusoid_iterator const& lhs, sprout::sinusoid_iterator const& rhs ) @@ -195,7 +195,7 @@ namespace sprout { return !(rhs < lhs); } template - SPROUT_CONSTEXPR bool operator>=( + inline SPROUT_CONSTEXPR bool operator>=( sprout::sinusoid_iterator const& lhs, sprout::sinusoid_iterator const& rhs ) @@ -203,7 +203,7 @@ namespace sprout { return !(lhs < rhs); } template - SPROUT_CONSTEXPR typename sprout::sinusoid_iterator::difference_type operator-( + inline SPROUT_CONSTEXPR typename sprout::sinusoid_iterator::difference_type operator-( sprout::sinusoid_iterator const& lhs, sprout::sinusoid_iterator const& rhs ) @@ -211,7 +211,7 @@ namespace sprout { return lhs.index() - rhs.index(); } template - SPROUT_CONSTEXPR sprout::sinusoid_iterator operator+( + inline SPROUT_CONSTEXPR sprout::sinusoid_iterator operator+( typename sprout::sinusoid_iterator::difference_type n, sprout::sinusoid_iterator const& it ) @@ -223,7 +223,7 @@ namespace sprout { // swap // template - void swap(sprout::sinusoid_iterator& lhs, sprout::sinusoid_iterator& rhs) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) { + inline void swap(sprout::sinusoid_iterator& lhs, sprout::sinusoid_iterator& rhs) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) { lhs.swap(rhs); } @@ -231,14 +231,14 @@ namespace sprout { // next // template - SPROUT_CONSTEXPR sprout::sinusoid_iterator next( + inline SPROUT_CONSTEXPR sprout::sinusoid_iterator next( sprout::sinusoid_iterator const& it ) { return it.next(); } template - SPROUT_CONSTEXPR sprout::sinusoid_iterator next( + inline SPROUT_CONSTEXPR sprout::sinusoid_iterator next( sprout::sinusoid_iterator const& it, typename sprout::sinusoid_iterator::difference_type n ) @@ -250,14 +250,14 @@ namespace sprout { // prev // template - SPROUT_CONSTEXPR sprout::sinusoid_iterator prev( + inline SPROUT_CONSTEXPR sprout::sinusoid_iterator prev( sprout::sinusoid_iterator const& it ) { return it.prev(); } template - SPROUT_CONSTEXPR sprout::sinusoid_iterator prev( + inline SPROUT_CONSTEXPR sprout::sinusoid_iterator prev( sprout::sinusoid_iterator const& it, typename sprout::sinusoid_iterator::difference_type n ) @@ -269,7 +269,7 @@ namespace sprout { // distance // template - SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type + inline SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type distance( sprout::sinusoid_iterator first, sprout::sinusoid_iterator last diff --git a/sprout/iterator/size_enum_iterator.hpp b/sprout/iterator/size_enum_iterator.hpp index 93713566..472e6566 100644 --- a/sprout/iterator/size_enum_iterator.hpp +++ b/sprout/iterator/size_enum_iterator.hpp @@ -266,7 +266,7 @@ namespace sprout { typename Iterator1, bool Separated1, typename Iterator2, bool Separated2 > - SPROUT_CONSTEXPR bool operator==( + inline SPROUT_CONSTEXPR bool operator==( sprout::size_enum_iterator const& lhs, sprout::size_enum_iterator const& rhs ) @@ -277,7 +277,7 @@ namespace sprout { typename Iterator1, bool Separated1, typename Iterator2, bool Separated2 > - SPROUT_CONSTEXPR bool operator!=( + inline SPROUT_CONSTEXPR bool operator!=( sprout::size_enum_iterator const& lhs, sprout::size_enum_iterator const& rhs ) @@ -288,7 +288,7 @@ namespace sprout { typename Iterator1, bool Separated1, typename Iterator2, bool Separated2 > - SPROUT_CONSTEXPR bool operator<( + inline SPROUT_CONSTEXPR bool operator<( sprout::size_enum_iterator const& lhs, sprout::size_enum_iterator const& rhs ) @@ -301,7 +301,7 @@ namespace sprout { typename Iterator1, bool Separated1, typename Iterator2, bool Separated2 > - SPROUT_CONSTEXPR bool operator>( + inline SPROUT_CONSTEXPR bool operator>( sprout::size_enum_iterator const& lhs, sprout::size_enum_iterator const& rhs ) @@ -312,7 +312,7 @@ namespace sprout { typename Iterator1, bool Separated1, typename Iterator2, bool Separated2 > - SPROUT_CONSTEXPR bool operator<=( + inline SPROUT_CONSTEXPR bool operator<=( sprout::size_enum_iterator const& lhs, sprout::size_enum_iterator const& rhs ) @@ -323,7 +323,7 @@ namespace sprout { typename Iterator1, bool Separated1, typename Iterator2, bool Separated2 > - SPROUT_CONSTEXPR bool operator>=( + inline SPROUT_CONSTEXPR bool operator>=( sprout::size_enum_iterator const& lhs, sprout::size_enum_iterator const& rhs ) @@ -331,7 +331,7 @@ namespace sprout { return !(lhs < rhs); } template - SPROUT_CONSTEXPR decltype(std::declval() - std::declval()) operator-( + inline SPROUT_CONSTEXPR decltype(std::declval() - std::declval()) operator-( sprout::size_enum_iterator const& lhs, sprout::size_enum_iterator const& rhs ) @@ -339,7 +339,7 @@ namespace sprout { return lhs.base() - rhs.base(); } template - SPROUT_CONSTEXPR decltype(std::declval() - std::declval()) operator-( + inline SPROUT_CONSTEXPR decltype(std::declval() - std::declval()) operator-( sprout::size_enum_iterator const& lhs, sprout::size_enum_iterator const& rhs ) @@ -352,7 +352,7 @@ namespace sprout { ; } template - SPROUT_CONSTEXPR sprout::size_enum_iterator operator+( + inline SPROUT_CONSTEXPR sprout::size_enum_iterator operator+( typename sprout::size_enum_iterator::difference_type n, sprout::size_enum_iterator const& it ) @@ -364,12 +364,12 @@ namespace sprout { // make_size_enum_iterator // template - SPROUT_CONSTEXPR sprout::size_enum_iterator + inline SPROUT_CONSTEXPR sprout::size_enum_iterator make_size_enum_iterator(Iterator it) { return sprout::size_enum_iterator(it); } template - SPROUT_CONSTEXPR sprout::size_enum_iterator + inline SPROUT_CONSTEXPR sprout::size_enum_iterator make_size_enum_iterator( Iterator it, typename sprout::size_enum_iterator::value_type sep_size, @@ -396,14 +396,14 @@ namespace sprout { // next // template - SPROUT_CONSTEXPR sprout::size_enum_iterator next( + inline SPROUT_CONSTEXPR sprout::size_enum_iterator next( sprout::size_enum_iterator const& it ) { return it.next(); } template - SPROUT_CONSTEXPR sprout::size_enum_iterator next( + inline SPROUT_CONSTEXPR sprout::size_enum_iterator next( sprout::size_enum_iterator const& it, typename sprout::size_enum_iterator::difference_type n ) @@ -415,14 +415,14 @@ namespace sprout { // prev // template - SPROUT_CONSTEXPR sprout::size_enum_iterator prev( + inline SPROUT_CONSTEXPR sprout::size_enum_iterator prev( sprout::size_enum_iterator const& it ) { return it.prev(); } template - SPROUT_CONSTEXPR sprout::size_enum_iterator prev( + inline SPROUT_CONSTEXPR sprout::size_enum_iterator prev( sprout::size_enum_iterator const& it, typename sprout::size_enum_iterator::difference_type n ) @@ -434,7 +434,7 @@ namespace sprout { // distance // template - SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type + inline SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type distance( sprout::size_enum_iterator first, sprout::size_enum_iterator last diff --git a/sprout/iterator/square_iterator.hpp b/sprout/iterator/square_iterator.hpp index fbec6254..d3b50b98 100644 --- a/sprout/iterator/square_iterator.hpp +++ b/sprout/iterator/square_iterator.hpp @@ -156,7 +156,7 @@ namespace sprout { }; template - SPROUT_CONSTEXPR bool operator==( + inline SPROUT_CONSTEXPR bool operator==( sprout::square_iterator const& lhs, sprout::square_iterator const& rhs ) @@ -164,7 +164,7 @@ namespace sprout { return lhs.index() == rhs.index(); } template - SPROUT_CONSTEXPR bool operator!=( + inline SPROUT_CONSTEXPR bool operator!=( sprout::square_iterator const& lhs, sprout::square_iterator const& rhs ) @@ -172,7 +172,7 @@ namespace sprout { return !(lhs == rhs); } template - SPROUT_CONSTEXPR bool operator<( + inline SPROUT_CONSTEXPR bool operator<( sprout::square_iterator const& lhs, sprout::square_iterator const& rhs ) @@ -180,7 +180,7 @@ namespace sprout { return lhs.index() < rhs.index(); } template - SPROUT_CONSTEXPR bool operator>( + inline SPROUT_CONSTEXPR bool operator>( sprout::square_iterator const& lhs, sprout::square_iterator const& rhs ) @@ -188,7 +188,7 @@ namespace sprout { return rhs < lhs; } template - SPROUT_CONSTEXPR bool operator<=( + inline SPROUT_CONSTEXPR bool operator<=( sprout::square_iterator const& lhs, sprout::square_iterator const& rhs ) @@ -196,7 +196,7 @@ namespace sprout { return !(rhs < lhs); } template - SPROUT_CONSTEXPR bool operator>=( + inline SPROUT_CONSTEXPR bool operator>=( sprout::square_iterator const& lhs, sprout::square_iterator const& rhs ) @@ -204,7 +204,7 @@ namespace sprout { return !(lhs < rhs); } template - SPROUT_CONSTEXPR typename sprout::square_iterator::difference_type operator-( + inline SPROUT_CONSTEXPR typename sprout::square_iterator::difference_type operator-( sprout::square_iterator const& lhs, sprout::square_iterator const& rhs ) @@ -212,7 +212,7 @@ namespace sprout { return lhs.index() - rhs.index(); } template - SPROUT_CONSTEXPR sprout::square_iterator operator+( + inline SPROUT_CONSTEXPR sprout::square_iterator operator+( typename sprout::square_iterator::difference_type n, sprout::square_iterator const& it ) @@ -224,7 +224,7 @@ namespace sprout { // swap // template - void swap(sprout::square_iterator& lhs, sprout::square_iterator& rhs) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) { + inline void swap(sprout::square_iterator& lhs, sprout::square_iterator& rhs) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) { lhs.swap(rhs); } @@ -232,14 +232,14 @@ namespace sprout { // next // template - SPROUT_CONSTEXPR sprout::square_iterator next( + inline SPROUT_CONSTEXPR sprout::square_iterator next( sprout::square_iterator const& it ) { return it.next(); } template - SPROUT_CONSTEXPR sprout::square_iterator next( + inline SPROUT_CONSTEXPR sprout::square_iterator next( sprout::square_iterator const& it, typename sprout::square_iterator::difference_type n ) @@ -251,14 +251,14 @@ namespace sprout { // prev // template - SPROUT_CONSTEXPR sprout::square_iterator prev( + inline SPROUT_CONSTEXPR sprout::square_iterator prev( sprout::square_iterator const& it ) { return it.prev(); } template - SPROUT_CONSTEXPR sprout::square_iterator prev( + inline SPROUT_CONSTEXPR sprout::square_iterator prev( sprout::square_iterator const& it, typename sprout::square_iterator::difference_type n ) @@ -270,7 +270,7 @@ namespace sprout { // distance // template - SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type + inline SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type distance( sprout::square_iterator first, sprout::square_iterator last diff --git a/sprout/iterator/transform_iterator.hpp b/sprout/iterator/transform_iterator.hpp index 4576d621..4c36643b 100644 --- a/sprout/iterator/transform_iterator.hpp +++ b/sprout/iterator/transform_iterator.hpp @@ -277,7 +277,7 @@ namespace sprout { typename UnaryOrBinaryFunction1, typename LIterator1, typename RIterator1, typename UnaryOrBinaryFunction2, typename LIterator2, typename RIterator2 > - SPROUT_CONSTEXPR bool operator==( + inline SPROUT_CONSTEXPR bool operator==( sprout::transform_iterator const& lhs, sprout::transform_iterator const& rhs ) @@ -288,7 +288,7 @@ namespace sprout { typename UnaryOrBinaryFunction1, typename LIterator1, typename RIterator1, typename UnaryOrBinaryFunction2, typename LIterator2, typename RIterator2 > - SPROUT_CONSTEXPR bool operator!=( + inline SPROUT_CONSTEXPR bool operator!=( sprout::transform_iterator const& lhs, sprout::transform_iterator const& rhs ) @@ -299,7 +299,7 @@ namespace sprout { typename UnaryOrBinaryFunction1, typename LIterator1, typename RIterator1, typename UnaryOrBinaryFunction2, typename LIterator2, typename RIterator2 > - SPROUT_CONSTEXPR bool operator<( + inline SPROUT_CONSTEXPR bool operator<( sprout::transform_iterator const& lhs, sprout::transform_iterator const& rhs ) @@ -310,7 +310,7 @@ namespace sprout { typename UnaryOrBinaryFunction1, typename LIterator1, typename RIterator1, typename UnaryOrBinaryFunction2, typename LIterator2, typename RIterator2 > - SPROUT_CONSTEXPR bool operator>( + inline SPROUT_CONSTEXPR bool operator>( sprout::transform_iterator const& lhs, sprout::transform_iterator const& rhs ) @@ -321,7 +321,7 @@ namespace sprout { typename UnaryOrBinaryFunction1, typename LIterator1, typename RIterator1, typename UnaryOrBinaryFunction2, typename LIterator2, typename RIterator2 > - SPROUT_CONSTEXPR bool operator<=( + inline SPROUT_CONSTEXPR bool operator<=( sprout::transform_iterator const& lhs, sprout::transform_iterator const& rhs ) @@ -332,7 +332,7 @@ namespace sprout { typename UnaryOrBinaryFunction1, typename LIterator1, typename RIterator1, typename UnaryOrBinaryFunction2, typename LIterator2, typename RIterator2 > - SPROUT_CONSTEXPR bool operator>=( + inline SPROUT_CONSTEXPR bool operator>=( sprout::transform_iterator const& lhs, sprout::transform_iterator const& rhs ) @@ -343,7 +343,7 @@ namespace sprout { typename UnaryOrBinaryFunction1, typename LIterator1, typename RIterator1, typename UnaryOrBinaryFunction2, typename LIterator2, typename RIterator2 > - SPROUT_CONSTEXPR decltype(std::declval() - std::declval()) operator-( + inline SPROUT_CONSTEXPR decltype(std::declval() - std::declval()) operator-( sprout::transform_iterator const& lhs, sprout::transform_iterator const& rhs ) @@ -351,7 +351,7 @@ namespace sprout { return lhs.base() - rhs.base(); } template - SPROUT_CONSTEXPR sprout::transform_iterator operator+( + inline SPROUT_CONSTEXPR sprout::transform_iterator operator+( typename sprout::transform_iterator::difference_type n, sprout::transform_iterator const& it ) @@ -363,12 +363,12 @@ namespace sprout { // make_transform_iterator // template - SPROUT_CONSTEXPR sprout::transform_iterator + inline SPROUT_CONSTEXPR sprout::transform_iterator make_transform_iterator(LIterator it1, RIterator it2, BinaryFunction func) { return sprout::transform_iterator(it1, it2, func); } template - SPROUT_CONSTEXPR sprout::transform_iterator + inline SPROUT_CONSTEXPR sprout::transform_iterator make_transform_iterator(Iterator it, UnaryFunction func) { return sprout::transform_iterator(it, func); } @@ -390,14 +390,14 @@ namespace sprout { // next // template - SPROUT_CONSTEXPR sprout::transform_iterator next( + inline SPROUT_CONSTEXPR sprout::transform_iterator next( sprout::transform_iterator const& it ) { return it.next(); } template - SPROUT_CONSTEXPR sprout::transform_iterator next( + inline SPROUT_CONSTEXPR sprout::transform_iterator next( sprout::transform_iterator const& it, typename sprout::transform_iterator::difference_type n ) @@ -409,14 +409,14 @@ namespace sprout { // prev // template - SPROUT_CONSTEXPR sprout::transform_iterator prev( + inline SPROUT_CONSTEXPR sprout::transform_iterator prev( sprout::transform_iterator const& it ) { return it.prev(); } template - SPROUT_CONSTEXPR sprout::transform_iterator prev( + inline SPROUT_CONSTEXPR sprout::transform_iterator prev( sprout::transform_iterator const& it, typename sprout::transform_iterator::difference_type n ) @@ -428,7 +428,7 @@ namespace sprout { // distance // template - SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type + inline SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type distance( sprout::transform_iterator first, sprout::transform_iterator last diff --git a/sprout/iterator/triangle_iterator.hpp b/sprout/iterator/triangle_iterator.hpp index c7193902..9f031c2f 100644 --- a/sprout/iterator/triangle_iterator.hpp +++ b/sprout/iterator/triangle_iterator.hpp @@ -146,7 +146,7 @@ namespace sprout { }; template - SPROUT_CONSTEXPR bool operator==( + inline SPROUT_CONSTEXPR bool operator==( sprout::triangle_iterator const& lhs, sprout::triangle_iterator const& rhs ) @@ -154,7 +154,7 @@ namespace sprout { return lhs.index() == rhs.index(); } template - SPROUT_CONSTEXPR bool operator!=( + inline SPROUT_CONSTEXPR bool operator!=( sprout::triangle_iterator const& lhs, sprout::triangle_iterator const& rhs ) @@ -162,7 +162,7 @@ namespace sprout { return !(lhs == rhs); } template - SPROUT_CONSTEXPR bool operator<( + inline SPROUT_CONSTEXPR bool operator<( sprout::triangle_iterator const& lhs, sprout::triangle_iterator const& rhs ) @@ -170,7 +170,7 @@ namespace sprout { return lhs.index() < rhs.index(); } template - SPROUT_CONSTEXPR bool operator>( + inline SPROUT_CONSTEXPR bool operator>( sprout::triangle_iterator const& lhs, sprout::triangle_iterator const& rhs ) @@ -178,7 +178,7 @@ namespace sprout { return rhs < lhs; } template - SPROUT_CONSTEXPR bool operator<=( + inline SPROUT_CONSTEXPR bool operator<=( sprout::triangle_iterator const& lhs, sprout::triangle_iterator const& rhs ) @@ -186,7 +186,7 @@ namespace sprout { return !(rhs < lhs); } template - SPROUT_CONSTEXPR bool operator>=( + inline SPROUT_CONSTEXPR bool operator>=( sprout::triangle_iterator const& lhs, sprout::triangle_iterator const& rhs ) @@ -194,7 +194,7 @@ namespace sprout { return !(lhs < rhs); } template - SPROUT_CONSTEXPR typename sprout::triangle_iterator::difference_type operator-( + inline SPROUT_CONSTEXPR typename sprout::triangle_iterator::difference_type operator-( sprout::triangle_iterator const& lhs, sprout::triangle_iterator const& rhs ) @@ -202,7 +202,7 @@ namespace sprout { return lhs.index() - rhs.index(); } template - SPROUT_CONSTEXPR sprout::triangle_iterator operator+( + inline SPROUT_CONSTEXPR sprout::triangle_iterator operator+( typename sprout::triangle_iterator::difference_type n, sprout::triangle_iterator const& it ) @@ -214,7 +214,7 @@ namespace sprout { // swap // template - void swap(sprout::triangle_iterator& lhs, sprout::triangle_iterator& rhs) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) { + inline void swap(sprout::triangle_iterator& lhs, sprout::triangle_iterator& rhs) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) { lhs.swap(rhs); } @@ -222,14 +222,14 @@ namespace sprout { // next // template - SPROUT_CONSTEXPR sprout::triangle_iterator next( + inline SPROUT_CONSTEXPR sprout::triangle_iterator next( sprout::triangle_iterator const& it ) { return it.next(); } template - SPROUT_CONSTEXPR sprout::triangle_iterator next( + inline SPROUT_CONSTEXPR sprout::triangle_iterator next( sprout::triangle_iterator const& it, typename sprout::triangle_iterator::difference_type n ) @@ -241,14 +241,14 @@ namespace sprout { // prev // template - SPROUT_CONSTEXPR sprout::triangle_iterator prev( + inline SPROUT_CONSTEXPR sprout::triangle_iterator prev( sprout::triangle_iterator const& it ) { return it.prev(); } template - SPROUT_CONSTEXPR sprout::triangle_iterator prev( + inline SPROUT_CONSTEXPR sprout::triangle_iterator prev( sprout::triangle_iterator const& it, typename sprout::triangle_iterator::difference_type n ) @@ -260,7 +260,7 @@ namespace sprout { // distance // template - SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type + inline SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type distance( sprout::triangle_iterator first, sprout::triangle_iterator last diff --git a/sprout/iterator/value_iterator.hpp b/sprout/iterator/value_iterator.hpp index 7ac767d0..215a7ec9 100644 --- a/sprout/iterator/value_iterator.hpp +++ b/sprout/iterator/value_iterator.hpp @@ -160,7 +160,7 @@ namespace sprout { // swap // template - void swap(sprout::value_iterator& lhs, sprout::value_iterator& rhs) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) { + inline void swap(sprout::value_iterator& lhs, sprout::value_iterator& rhs) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) { lhs.swap(rhs); } @@ -168,14 +168,14 @@ namespace sprout { // next // template - SPROUT_CONSTEXPR sprout::value_iterator next( + inline SPROUT_CONSTEXPR sprout::value_iterator next( sprout::value_iterator const& it ) { return it.next(); } template - SPROUT_CONSTEXPR sprout::value_iterator next( + inline SPROUT_CONSTEXPR sprout::value_iterator next( sprout::value_iterator const& it, typename sprout::value_iterator::difference_type n ) @@ -187,14 +187,14 @@ namespace sprout { // prev // template - SPROUT_CONSTEXPR sprout::value_iterator prev( + inline SPROUT_CONSTEXPR sprout::value_iterator prev( sprout::value_iterator const& it ) { return it.prev(); } template - SPROUT_CONSTEXPR sprout::value_iterator prev( + inline SPROUT_CONSTEXPR sprout::value_iterator prev( sprout::value_iterator const& it, typename sprout::value_iterator::difference_type n ) @@ -206,7 +206,7 @@ namespace sprout { // distance // template - SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type + inline SPROUT_CONSTEXPR typename std::iterator_traits >::difference_type distance(sprout::value_iterator first, sprout::value_iterator last) { return last - first; } diff --git a/sprout/math/bernoulli.hpp b/sprout/math/bernoulli.hpp index 777de681..a37e5504 100644 --- a/sprout/math/bernoulli.hpp +++ b/sprout/math/bernoulli.hpp @@ -223,7 +223,7 @@ namespace sprout { // bernoulli_number_limit // template::value>::type> - SPROUT_CONSTEXPR std::size_t bernoulli_number_limit() { + inline SPROUT_CONSTEXPR std::size_t bernoulli_number_limit() { typedef typename std::remove_cv::type type; return sprout::math::detail::bernoulli_numbers::limit; } @@ -231,7 +231,7 @@ namespace sprout { // bernoulli_number // template::value>::type> - SPROUT_CONSTEXPR T bernoulli_number(std::size_t x) { + inline SPROUT_CONSTEXPR T bernoulli_number(std::size_t x) { typedef typename std::remove_cv::type type; return x <= sprout::math::bernoulli_number_limit() ? x == 1 ? type(-1) / 2 diff --git a/sprout/math/factorial.hpp b/sprout/math/factorial.hpp index c666ff05..1d38f4f6 100644 --- a/sprout/math/factorial.hpp +++ b/sprout/math/factorial.hpp @@ -757,7 +757,7 @@ namespace sprout { // factorial_limit // template::value>::type> - SPROUT_CONSTEXPR std::size_t factorial_limit() { + inline SPROUT_CONSTEXPR std::size_t factorial_limit() { typedef typename std::remove_cv::type type; return sprout::math::detail::factorials::limit; } @@ -765,7 +765,7 @@ namespace sprout { // factorial // template::value>::type> - SPROUT_CONSTEXPR T factorial(std::size_t x) { + inline SPROUT_CONSTEXPR T factorial(std::size_t x) { typedef typename std::remove_cv::type type; return x <= sprout::math::factorial_limit() ? sprout::math::detail::factorials::table[x] diff --git a/sprout/numeric/dft.hpp b/sprout/numeric/dft.hpp index 6b4b38f4..7c9c642b 100644 --- a/sprout/numeric/dft.hpp +++ b/sprout/numeric/dft.hpp @@ -6,12 +6,7 @@ #include #include #include -#include -#include #include -#include -#include -#include -#include +#include #endif // #ifndef SPROUT_NUMERIC_DFT_HPP diff --git a/sprout/numeric/dft/fit/wave.hpp b/sprout/numeric/dft/fit/wave.hpp new file mode 100644 index 00000000..ffe7f69b --- /dev/null +++ b/sprout/numeric/dft/fit/wave.hpp @@ -0,0 +1,10 @@ +#ifndef SPROUT_NUMERIC_DFT_FIT_WAVE_HPP +#define SPROUT_NUMERIC_DFT_FIT_WAVE_HPP + +#include +#include +#include +#include +#include + +#endif // #ifndef SPROUT_NUMERIC_DFT_FIT_WAVE_HPP diff --git a/sprout/numeric/dft/fixed/wave.hpp b/sprout/numeric/dft/fixed/wave.hpp new file mode 100644 index 00000000..76041103 --- /dev/null +++ b/sprout/numeric/dft/fixed/wave.hpp @@ -0,0 +1,10 @@ +#ifndef SPROUT_NUMERIC_DFT_FIXED_WAVE_HPP +#define SPROUT_NUMERIC_DFT_FIXED_WAVE_HPP + +#include +#include +#include +#include +#include + +#endif // #ifndef SPROUT_NUMERIC_DFT_FIXED_WAVE_HPP diff --git a/sprout/numeric/dft/wave.hpp b/sprout/numeric/dft/wave.hpp new file mode 100644 index 00000000..02972f7b --- /dev/null +++ b/sprout/numeric/dft/wave.hpp @@ -0,0 +1,8 @@ +#ifndef SPROUT_NUMERIC_DFT_WAVE_HPP +#define SPROUT_NUMERIC_DFT_WAVE_HPP + +#include +#include +#include + +#endif // #ifndef SPROUT_NUMERIC_DFT_WAVE_HPP diff --git a/sprout/pit.hpp b/sprout/pit.hpp index e5bcbe98..62f59d3b 100644 --- a/sprout/pit.hpp +++ b/sprout/pit.hpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #endif // #ifndef SPROUT_PIT_HPP diff --git a/sprout/pit/hash.hpp b/sprout/pit/hash.hpp index ebf46dd1..fd78832a 100644 --- a/sprout/pit/hash.hpp +++ b/sprout/pit/hash.hpp @@ -8,7 +8,7 @@ namespace sprout { template - SPROUT_CONSTEXPR std::size_t hash_value(sprout::pit const& v) { + inline SPROUT_CONSTEXPR std::size_t hash_value(sprout::pit const& v) { return sprout::to_hash(v.elem); } } // namespace sprout diff --git a/sprout/pit/type_traits.hpp b/sprout/pit/type_traits.hpp new file mode 100644 index 00000000..0ebcc1c3 --- /dev/null +++ b/sprout/pit/type_traits.hpp @@ -0,0 +1,30 @@ +#ifndef SPROUT_PIT_TYPE_TRAITS_HPP +#define SPROUT_PIT_TYPE_TRAITS_HPP + +#include +#include +#include + +namespace sprout { + // + // is_pit + // + template + struct is_pit + : public std::false_type + {}; + template + struct is_pit + : public sprout::is_pit + {}; + template + struct is_pit + : public sprout::is_pit + {}; + template + struct is_pit > + : public std::true_type + {}; +} // namespace sprout + +#endif // #ifndef SPROUT_PIT_TYPE_TRAITS_HPP diff --git a/sprout/range/adaptor.hpp b/sprout/range/adaptor.hpp index 9b8ce6a1..3433d306 100644 --- a/sprout/range/adaptor.hpp +++ b/sprout/range/adaptor.hpp @@ -8,9 +8,6 @@ #include #include #include -#include -#include -#include -#include +#include #endif // #ifndef SPROUT_RANGE_ADAPTOR_HPP diff --git a/sprout/range/adaptor/wave.hpp b/sprout/range/adaptor/wave.hpp new file mode 100644 index 00000000..c66b9989 --- /dev/null +++ b/sprout/range/adaptor/wave.hpp @@ -0,0 +1,10 @@ +#ifndef SPROUT_RANGE_ADAPTOR_WAVE_HPP +#define SPROUT_RANGE_ADAPTOR_WAVE_HPP + +#include +#include +#include +#include +#include + +#endif // #ifndef SPROUT_RANGE_ADAPTOR_WAVE_HPP diff --git a/sprout/range/numeric/dft.hpp b/sprout/range/numeric/dft.hpp index 4056a5aa..09605168 100644 --- a/sprout/range/numeric/dft.hpp +++ b/sprout/range/numeric/dft.hpp @@ -4,8 +4,6 @@ #include #include #include -#include -#include #include #endif // #ifndef SPROUT_RANGE_NUMERIC_DFT_HPP diff --git a/sprout/string/shrink.hpp b/sprout/string/shrink.hpp index 9ee38bec..71b0c526 100644 --- a/sprout/string/shrink.hpp +++ b/sprout/string/shrink.hpp @@ -54,7 +54,7 @@ namespace sprout { // shrink // template - SPROUT_CONSTEXPR sprout::shrink_string + inline SPROUT_CONSTEXPR sprout::shrink_string shrink(sprout::basic_string const& s) { return sprout::shrink_string(s); } diff --git a/sprout/tuple/tuple.hpp b/sprout/tuple/tuple.hpp index 9e98b93a..abd15dc0 100644 --- a/sprout/tuple/tuple.hpp +++ b/sprout/tuple/tuple.hpp @@ -501,7 +501,7 @@ namespace sprout { // get // template - SPROUT_CONSTEXPR auto + inline SPROUT_CONSTEXPR auto get(T&& t) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::get(sprout::forward(t)))) -> decltype(std::get(sprout::forward(t))) { @@ -512,30 +512,30 @@ namespace sprout { // namespace detail { template - SPROUT_CONSTEXPR typename std::add_lvalue_reference::type + inline SPROUT_CONSTEXPR typename std::add_lvalue_reference::type get_helper(sprout::tuples::detail::tuple_impl& t) SPROUT_NOEXCEPT { return sprout::tuples::detail::tuple_impl::head(t); } template - SPROUT_CONSTEXPR typename std::add_lvalue_reference::type>::type + inline SPROUT_CONSTEXPR typename std::add_lvalue_reference::type>::type get_helper(sprout::tuples::detail::tuple_impl const& t) SPROUT_NOEXCEPT { return sprout::tuples::detail::tuple_impl::head(t); } } // namespace detail template - SPROUT_CONSTEXPR typename sprout::tuples::tuple_element >::type& + inline SPROUT_CONSTEXPR typename sprout::tuples::tuple_element >::type& get(sprout::tuples::tuple& t) SPROUT_NOEXCEPT { return sprout::tuples::detail::get_helper(t); } template - SPROUT_CONSTEXPR typename sprout::tuples::tuple_element >::type&& + inline SPROUT_CONSTEXPR typename sprout::tuples::tuple_element >::type&& get(sprout::tuples::tuple&& t) SPROUT_NOEXCEPT { return sprout::forward >::type&&>( sprout::tuples::get(t) ); } template - SPROUT_CONSTEXPR typename sprout::tuples::tuple_element >::type const& + inline SPROUT_CONSTEXPR typename sprout::tuples::tuple_element >::type const& get(sprout::tuples::tuple const& t) SPROUT_NOEXCEPT { return sprout::tuples::detail::get_helper(t); } diff --git a/sprout/utility/pack.hpp b/sprout/utility/pack.hpp index d864e129..2bcd4ba2 100644 --- a/sprout/utility/pack.hpp +++ b/sprout/utility/pack.hpp @@ -48,7 +48,7 @@ namespace sprout { typename... Tail, typename sprout::enabler_if::type = sprout::enabler > - SPROUT_CONSTEXPR R fppack_at_impl(Head&& head, Tail&&... tail) { + inline SPROUT_CONSTEXPR R fppack_at_impl(Head&& head, Tail&&... tail) { return sprout::forward(head); } template< @@ -58,12 +58,12 @@ namespace sprout { typename... Tail, typename sprout::enabler_if::type = sprout::enabler > - SPROUT_CONSTEXPR R fppack_at_impl(Head&& head, Tail&&... tail) { + inline SPROUT_CONSTEXPR R fppack_at_impl(Head&& head, Tail&&... tail) { return sprout::detail::fppack_at_impl(sprout::forward(tail)...); } } // namespace detail template - SPROUT_CONSTEXPR typename sprout::tppack_at::type fppack_at(Args&&... args) { + inline SPROUT_CONSTEXPR typename sprout::tppack_at::type fppack_at(Args&&... args) { return sprout::detail::fppack_at_impl< N, typename sprout::tppack_at::type diff --git a/sprout/uuid/uuid_hash.hpp b/sprout/uuid/uuid_hash.hpp index 5423499d..fff4ce5c 100644 --- a/sprout/uuid/uuid_hash.hpp +++ b/sprout/uuid/uuid_hash.hpp @@ -7,7 +7,7 @@ #include namespace sprout { - SPROUT_CONSTEXPR std::size_t hash_value(sprout::uuids::uuid const& v) { + inline SPROUT_CONSTEXPR std::size_t hash_value(sprout::uuids::uuid const& v) { return sprout::hash_range(v.begin(), v.end()); } } // namespace sprout diff --git a/sprout/variant/get.hpp b/sprout/variant/get.hpp index bfc6024f..69535633 100644 --- a/sprout/variant/get.hpp +++ b/sprout/variant/get.hpp @@ -11,22 +11,22 @@ namespace sprout { // get // template - SPROUT_CONSTEXPR U const& get(sprout::variant const& operand) { + inline SPROUT_CONSTEXPR U const& get(sprout::variant const& operand) { return operand.template get(); } template - U& get(sprout::variant& operand) { + inline SPROUT_CONSTEXPR U& get(sprout::variant& operand) { return operand.template get(); } template - SPROUT_CONSTEXPR typename sprout::tuples::tuple_element< + inline SPROUT_CONSTEXPR typename sprout::tuples::tuple_element< I, sprout::variant >::type const& get(sprout::variant const& operand) { return operand.template get_at(); } template - typename sprout::tuples::tuple_element< + inline SPROUT_CONSTEXPR typename sprout::tuples::tuple_element< I, sprout::variant >::type& get(sprout::variant& operand) { diff --git a/sprout/weed/detail/bdigits.hpp b/sprout/weed/detail/bdigits.hpp index d0c3c02d..31de2db9 100644 --- a/sprout/weed/detail/bdigits.hpp +++ b/sprout/weed/detail/bdigits.hpp @@ -82,7 +82,7 @@ namespace sprout { # undef SPROUT_WEED_BDIGITS_TABLE_DEF template - SPROUT_CONSTEXPR sprout::tuples::tuple bvalue_at(std::size_t i) { + inline SPROUT_CONSTEXPR sprout::tuples::tuple bvalue_at(std::size_t i) { return i < 2 ? sprout::tuples::tuple( static_cast(sprout::weed::detail::bvalues::table[i]), @@ -95,7 +95,7 @@ namespace sprout { ; } template - SPROUT_CONSTEXPR sprout::tuples::tuple from_bdigit(Elem c) { + inline SPROUT_CONSTEXPR sprout::tuples::tuple from_bdigit(Elem c) { return sprout::weed::detail::bvalue_at( NS_SSCRISK_CEL_OR_SPROUT::distance( sprout::weed::detail::bdigits::table.begin(), diff --git a/sprout/weed/detail/digits.hpp b/sprout/weed/detail/digits.hpp index ef3aaa35..79e2543c 100644 --- a/sprout/weed/detail/digits.hpp +++ b/sprout/weed/detail/digits.hpp @@ -82,7 +82,7 @@ namespace sprout { # undef SPROUT_WEED_DIGITS_TABLE_DEF template - SPROUT_CONSTEXPR sprout::tuples::tuple value_at(std::size_t i) { + inline SPROUT_CONSTEXPR sprout::tuples::tuple value_at(std::size_t i) { return i < 10 ? sprout::tuples::tuple( static_cast(sprout::weed::detail::values::table[i]), @@ -95,7 +95,7 @@ namespace sprout { ; } template - SPROUT_CONSTEXPR sprout::tuples::tuple from_digit(Elem c) { + inline SPROUT_CONSTEXPR sprout::tuples::tuple from_digit(Elem c) { return sprout::weed::detail::value_at( NS_SSCRISK_CEL_OR_SPROUT::distance( sprout::weed::detail::digits::table.begin(), diff --git a/sprout/weed/detail/ndigits.hpp b/sprout/weed/detail/ndigits.hpp index 430fe59a..3d44584e 100644 --- a/sprout/weed/detail/ndigits.hpp +++ b/sprout/weed/detail/ndigits.hpp @@ -14,7 +14,7 @@ namespace sprout { namespace weed { namespace detail { template - SPROUT_CONSTEXPR sprout::tuples::tuple from_ndigit( + inline SPROUT_CONSTEXPR sprout::tuples::tuple from_ndigit( Elem c, typename std::enable_if::type* = 0 ) @@ -22,7 +22,7 @@ namespace sprout { return sprout::weed::detail::from_digit(c); } template - SPROUT_CONSTEXPR sprout::tuples::tuple from_ndigit( + inline SPROUT_CONSTEXPR sprout::tuples::tuple from_ndigit( Elem c, typename std::enable_if::type* = 0 ) @@ -30,7 +30,7 @@ namespace sprout { return sprout::weed::detail::from_bdigit(c); } template - SPROUT_CONSTEXPR sprout::tuples::tuple from_ndigit( + inline SPROUT_CONSTEXPR sprout::tuples::tuple from_ndigit( Elem c, typename std::enable_if::type* = 0 ) @@ -38,7 +38,7 @@ namespace sprout { return sprout::weed::detail::from_odigit(c); } template - SPROUT_CONSTEXPR sprout::tuples::tuple from_ndigit( + inline SPROUT_CONSTEXPR sprout::tuples::tuple from_ndigit( Elem c, typename std::enable_if::type* = 0 ) diff --git a/sprout/weed/detail/odigits.hpp b/sprout/weed/detail/odigits.hpp index ab734950..09d40d35 100644 --- a/sprout/weed/detail/odigits.hpp +++ b/sprout/weed/detail/odigits.hpp @@ -82,7 +82,7 @@ namespace sprout { # undef SPROUT_WEED_ODIGITS_TABLE_DEF template - SPROUT_CONSTEXPR sprout::tuples::tuple ovalue_at(std::size_t i) { + inline SPROUT_CONSTEXPR sprout::tuples::tuple ovalue_at(std::size_t i) { return i < 8 ? sprout::tuples::tuple( static_cast(sprout::weed::detail::ovalues::table[i]), @@ -95,7 +95,7 @@ namespace sprout { ; } template - SPROUT_CONSTEXPR sprout::tuples::tuple from_odigit(Elem c) { + inline SPROUT_CONSTEXPR sprout::tuples::tuple from_odigit(Elem c) { return sprout::weed::detail::ovalue_at( NS_SSCRISK_CEL_OR_SPROUT::distance( sprout::weed::detail::odigits::table.begin(), diff --git a/sprout/weed/detail/xdigits.hpp b/sprout/weed/detail/xdigits.hpp index 6908a467..98764396 100644 --- a/sprout/weed/detail/xdigits.hpp +++ b/sprout/weed/detail/xdigits.hpp @@ -82,7 +82,7 @@ namespace sprout { # undef SPROUT_WEED_XDIGITS_TABLE_DEF template - SPROUT_CONSTEXPR sprout::tuples::tuple xvalue_at(std::size_t i) { + inline SPROUT_CONSTEXPR sprout::tuples::tuple xvalue_at(std::size_t i) { return i < 22 ? sprout::tuples::tuple( static_cast(sprout::weed::detail::xvalues::table[i]), @@ -95,7 +95,7 @@ namespace sprout { ; } template - SPROUT_CONSTEXPR sprout::tuples::tuple from_xdigit(Elem c) { + inline SPROUT_CONSTEXPR sprout::tuples::tuple from_xdigit(Elem c) { return sprout::weed::detail::xvalue_at( NS_SSCRISK_CEL_OR_SPROUT::distance( sprout::weed::detail::xdigits::table.begin(),