mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
add macro SPROUT_NON_CONSTEXPR
This commit is contained in:
parent
6b1ef202d8
commit
1132d08f23
37 changed files with 209 additions and 204 deletions
|
@ -27,7 +27,7 @@ namespace sprout {
|
|||
: out_(out)
|
||||
{}
|
||||
template<typename T>
|
||||
void operator()(T const& operand) const {
|
||||
SPROUT_CXX14_CONSTEXPR void operator()(T const& operand) const {
|
||||
out_ << operand;
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ namespace sprout {
|
|||
// operator<<
|
||||
//
|
||||
template<typename Elem, typename Traits, typename... Types>
|
||||
inline std::basic_ostream<Elem, Traits>&
|
||||
inline SPROUT_NON_CONSTEXPR std::basic_ostream<Elem, Traits>&
|
||||
operator<<(std::basic_ostream<Elem, Traits>& lhs, sprout::variant<Types...> const& rhs) {
|
||||
sprout::detail::variant_output_visitor<std::basic_ostream<Elem, Traits> > visitor(lhs);
|
||||
rhs.apply_visitor(visitor);
|
||||
|
|
|
@ -187,14 +187,14 @@ namespace sprout {
|
|||
;
|
||||
}
|
||||
template<int I, typename Elem, typename Traits>
|
||||
static typename std::enable_if<
|
||||
static SPROUT_NON_CONSTEXPR typename std::enable_if<
|
||||
static_cast<std::size_t>(I) == sizeof...(Types),
|
||||
std::basic_ostream<Elem, Traits>&
|
||||
>::type output(std::basic_ostream<Elem, Traits>& os, tuple_type const&, int) {
|
||||
return os;
|
||||
}
|
||||
template<int I, typename Elem, typename Traits>
|
||||
static typename std::enable_if<
|
||||
static SPROUT_NON_CONSTEXPR typename std::enable_if<
|
||||
static_cast<std::size_t>(I) != sizeof...(Types),
|
||||
std::basic_ostream<Elem, Traits>&
|
||||
>::type output(std::basic_ostream<Elem, Traits>& os, tuple_type const& t, int which) {
|
||||
|
@ -288,7 +288,7 @@ namespace sprout {
|
|||
}
|
||||
|
||||
template<typename Elem, typename Traits>
|
||||
friend std::basic_ostream<Elem, Traits>& operator<<(std::basic_ostream<Elem, Traits>& lhs, variant const& rhs) {
|
||||
friend SPROUT_NON_CONSTEXPR std::basic_ostream<Elem, Traits>& operator<<(std::basic_ostream<Elem, Traits>& lhs, variant const& rhs) {
|
||||
return output<0>(lhs, rhs.tuple_, rhs.which_);
|
||||
}
|
||||
// get support
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue