added: operator<< for tvec1<>

This commit is contained in:
jan p springer 2015-01-14 22:10:55 +00:00
parent 8b09606c7b
commit d30aba45e0
2 changed files with 32 additions and 0 deletions

View File

@ -188,6 +188,8 @@ namespace glm
template <typename CTy, typename CTr, typename T, precision P>
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tquat<T,P> const&);
template <typename CTy, typename CTr, typename T, precision P>
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tvec1<T,P> const&);
template <typename CTy, typename CTr, typename T, precision P>
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tvec2<T,P> const&);
template <typename CTy, typename CTr, typename T, precision P>
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tvec3<T,P> const&);

View File

@ -218,6 +218,36 @@ namespace io
return os;
}
template <typename CTy, typename CTr, typename T, precision P>
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tvec1<T,P> const& a)
{
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os);
if(cerberus)
{
io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os));
if(fmt.formatted)
{
io::basic_state_saver<CTy> const bss(os);
os << std::fixed
<< std::right
<< std::setprecision(fmt.precision)
<< std::setfill(fmt.space)
<< fmt.delim_left
<< std::setw(fmt.width) << a.x
<< fmt.delim_right;
}
else
{
os << a.x;
}
}
return os;
}
template <typename CTy, typename CTr, typename T, precision P>
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tvec2<T,P> const& a)
{