mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-04 14:14:09 +00:00
support polymorphic visitor (variant)
This commit is contained in:
parent
9ee3e03ddd
commit
f01382e3e5
8 changed files with 204 additions and 24 deletions
25
sprout/string/stretch.hpp
Normal file
25
sprout/string/stretch.hpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
#ifndef SPROUT_STRING_STRETCH_HPP
|
||||
#define SPROUT_STRING_STRETCH_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/string/string.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// stretch
|
||||
//
|
||||
template<std::size_t To, typename T, std::size_t N, typename Traits>
|
||||
inline SPROUT_CONSTEXPR sprout::basic_string<T, To, Traits>
|
||||
stretch(sprout::basic_string<T, N, Traits> const& s) {
|
||||
return s;
|
||||
}
|
||||
|
||||
template<std::size_t To, typename T, std::size_t N>
|
||||
inline SPROUT_CONSTEXPR sprout::basic_string<T, To>
|
||||
stretch(T const(& arr)[N]) {
|
||||
return sprout::stretch<To>(sprout::to_string(arr));
|
||||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_STRING_STRETCH_HPP
|
Loading…
Add table
Add a link
Reference in a new issue