Skip to content
Snippets Groups Projects
Commit 0ef45b13 authored by Jakub Klinkovský's avatar Jakub Klinkovský Committed by Jakub Klinkovský
Browse files

NDArray: moved SizesHolderStaticSizePrinter and SizesHolderSizePrinter into...

NDArray: moved SizesHolderStaticSizePrinter and SizesHolderSizePrinter into the implementation namespace
parent 3144060d
No related branches found
No related tags found
1 merge request!18NDArray
......@@ -123,6 +123,26 @@ protected:
}
};
template< std::size_t dimension >
struct SizesHolderStaticSizePrinter
{
template< typename SizesHolder >
static void exec( std::ostream& str, const SizesHolder& holder )
{
str << holder.template getStaticSize< dimension >() << ", ";
}
};
template< std::size_t dimension >
struct SizesHolderSizePrinter
{
template< typename SizesHolder >
static void exec( std::ostream& str, const SizesHolder& holder )
{
str << holder.template getSize< dimension >() << ", ";
}
};
} // namespace __ndarray_impl
......@@ -181,36 +201,14 @@ public:
};
template< std::size_t dimension >
struct SizesHolderStaticSizePrinter
{
template< typename Index,
std::size_t... sizes >
static void exec( std::ostream& str, const SizesHolder< Index, sizes... >& holder )
{
str << holder.template getStaticSize< dimension >() << ", ";
}
};
template< std::size_t dimension >
struct SizesHolderSizePrinter
{
template< typename Index,
std::size_t... sizes >
static void exec( std::ostream& str, const SizesHolder< Index, sizes... >& holder )
{
str << holder.template getSize< dimension >() << ", ";
}
};
template< typename Index,
std::size_t... sizes >
std::ostream& operator<<( std::ostream& str, const SizesHolder< Index, sizes... >& holder )
{
str << "SizesHolder< ";
TemplateStaticFor< std::size_t, 0, sizeof...(sizes) - 1, SizesHolderStaticSizePrinter >::execHost( str, holder );
TemplateStaticFor< std::size_t, 0, sizeof...(sizes) - 1, __ndarray_impl::SizesHolderStaticSizePrinter >::execHost( str, holder );
str << holder.template getStaticSize< sizeof...(sizes) - 1 >() << " >( ";
TemplateStaticFor< std::size_t, 0, sizeof...(sizes) - 1, SizesHolderSizePrinter >::execHost( str, holder );
TemplateStaticFor< std::size_t, 0, sizeof...(sizes) - 1, __ndarray_impl::SizesHolderSizePrinter >::execHost( str, holder );
str << holder.template getSize< sizeof...(sizes) - 1 >() << " )";
return str;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment