Add 'xo-flatstring/' from commit 'ebbe45e5e7'
git-subtree-dir: xo-flatstring git-subtree-mainline:1eb4114722git-subtree-split:ebbe45e5e7
This commit is contained in:
commit
852dbe66dd
30 changed files with 2464 additions and 0 deletions
37
xo-flatstring/include/xo/flatstring/flatstring_iostream.hpp
Normal file
37
xo-flatstring/include/xo/flatstring/flatstring_iostream.hpp
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/** @file flatstring_iostream.hpp
|
||||
*
|
||||
* Author: Roland Conybeare
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "flatstring.hpp"
|
||||
#include <ostream>
|
||||
//#include <cstdint>
|
||||
|
||||
namespace xo {
|
||||
/** @brief print flatstring on stream os.
|
||||
*
|
||||
**/
|
||||
template <std::size_t N>
|
||||
void
|
||||
print_flatstring (std::ostream & os, const flatstring<N> & x) {
|
||||
os << x.c_str();
|
||||
}
|
||||
|
||||
/** @brief print flatstring x on stream os.
|
||||
*
|
||||
* Example
|
||||
* @code
|
||||
* cout << flatstring("foo"); // outputs "foo"
|
||||
* @endcode
|
||||
**/
|
||||
template <std::size_t N>
|
||||
inline std::ostream &
|
||||
operator<< (std::ostream & os, const flatstring<N> & x) {
|
||||
print_flatstring(os, x);
|
||||
return os;
|
||||
}
|
||||
} /*namespace xo*/
|
||||
|
||||
/** end flatstring_iostream.hpp **/
|
||||
Loading…
Add table
Add a link
Reference in a new issue