Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinniefalco/475b84011b2ecb1ef8c929611c230025 to your computer and use it in GitHub Desktop.
Save vinniefalco/475b84011b2ecb1ef8c929611c230025 to your computer and use it in GitHub Desktop.
template<class T, class = void>
struct is_buffers_generator
: std::false_type
{
};
template<class T, class = void>
struct is_buffers_generator<T, detail::void_t<
std::is_constructible<
typename T::const_buffers_type, decltype(
std::declval<T&>().prepare(
std::declval<error_code&>()))>,
std::declval<T&>().consume(
std::declval<std::size_t>())>
> : std::true_type
{
};
/** A buffer sequence generator.
*/
struct BuffersGenerator
{
using const_buffers_type = __implementation_defined__;
const_buffers_type prepare( error_code& ec );
void consume( std::size_t n );
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment