proxygen
folly::DynamicConstructor< std::vector< bool >, void > Struct Template Reference

#include <DynamicConverter.h>

Static Public Member Functions

static dynamic construct (const std::vector< bool > &x)
 

Detailed Description

template<>
struct folly::DynamicConstructor< std::vector< bool >, void >

Definition at line 377 of file DynamicConverter.h.

Member Function Documentation

static dynamic folly::DynamicConstructor< std::vector< bool >, void >::construct ( const std::vector< bool > &  x)
inlinestatic

Definition at line 378 of file DynamicConverter.h.

References folly::dynamic::array(), folly::dynamic::push_back(), and folly::toDynamic().

378  {
379  dynamic d = dynamic::array;
380  // Intentionally specifying the type as bool here.
381  // std::vector<bool>'s iterators return a proxy which is a prvalue
382  // and hence cannot bind to an lvalue reference such as auto&
383  for (bool item : x) {
384  d.push_back(toDynamic(item));
385  }
386  return d;
387  }
static void array(EmptyArrayTag)
Definition: dynamic-inl.h:233
dynamic toDynamic(const T &)

The documentation for this struct was generated from the following file: