mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-16 15:14:13 +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
|
@ -19,7 +19,7 @@ namespace sprout {
|
|||
// operator<<
|
||||
//
|
||||
template<typename T, std::size_t N, typename Traits, typename StreamTraits>
|
||||
inline std::basic_istream<T, StreamTraits>&
|
||||
inline SPROUT_NON_CONSTEXPR std::basic_istream<T, StreamTraits>&
|
||||
operator>>(std::basic_istream<T, StreamTraits>& lhs, sprout::basic_string<T, N, Traits>& rhs) {
|
||||
typedef T elem_type;
|
||||
typedef StreamTraits traits_type;
|
||||
|
@ -62,7 +62,7 @@ namespace sprout {
|
|||
return lhs;
|
||||
}
|
||||
template<typename T, std::size_t N, typename Traits, typename StreamTraits>
|
||||
inline std::basic_ostream<T, StreamTraits>&
|
||||
inline SPROUT_NON_CONSTEXPR std::basic_ostream<T, StreamTraits>&
|
||||
operator<<(std::basic_ostream<T, StreamTraits>& lhs, sprout::basic_string<T, N, Traits> const& rhs) {
|
||||
return lhs << rhs.c_str();
|
||||
}
|
||||
|
|
|
@ -267,7 +267,7 @@ namespace sprout {
|
|||
static SPROUT_CONSTEXPR basic_string from_c_str(T const* s) {
|
||||
return basic_string(s);
|
||||
}
|
||||
static SPROUT_CONSTEXPR basic_string from_c_str(std::basic_string<T, Traits> const& s) {
|
||||
static SPROUT_NON_CONSTEXPR basic_string from_c_str(std::basic_string<T, Traits> const& s) {
|
||||
return from_c_str(s.data(), s.size());
|
||||
}
|
||||
private:
|
||||
|
@ -759,7 +759,7 @@ namespace sprout {
|
|||
}
|
||||
// conversions:
|
||||
template<typename Allocator>
|
||||
SPROUT_EXPLICIT_CONVERSION operator std::basic_string<T, Traits, Allocator>() const {
|
||||
SPROUT_EXPLICIT_CONVERSION SPROUT_NON_CONSTEXPR operator std::basic_string<T, Traits, Allocator>() const {
|
||||
return std::basic_string<T, Traits, Allocator>(data(), size());
|
||||
}
|
||||
|
||||
|
@ -1022,7 +1022,7 @@ namespace sprout {
|
|||
return sprout::basic_string<T, N>::from_c_str(s);
|
||||
}
|
||||
template<std::size_t N, typename T, typename Traits>
|
||||
inline SPROUT_CONSTEXPR sprout::basic_string<T, N, Traits>
|
||||
inline SPROUT_NON_CONSTEXPR sprout::basic_string<T, N, Traits>
|
||||
string_from_c_str(std::basic_string<T, Traits> const& s) {
|
||||
return sprout::basic_string<T, N, Traits>::from_c_str(s);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue