io: ensure view writes only take byte sized data

This commit is contained in:
Danny Robson 2018-01-10 18:44:23 +11:00
parent 2f31cb5a1d
commit b8fd18f1cc

10
io.hpp
View File

@ -73,7 +73,15 @@ namespace util {
/// an exception may be thrown in the event forward progress is impossible.
/// in this event the progress may not be reported to the caller. in the
/// future an exception member variable may expose the information.
template <typename DstT, typename IteratorA, typename IteratorB>
template <
typename DstT,
typename IteratorA,
typename IteratorB,
typename = std::enable_if_t<
sizeof (util::view<IteratorA,IteratorB>::value_type) == 1,
void
>
>
util::view<IteratorA,IteratorB>
write (DstT &dst, const util::view<IteratorA, IteratorB> src)
{