CppWAMP
C++11 client library for the WAMP protocol
|
Go to the documentation of this file.
7 #ifndef CPPWAMP_TYPES_SET_HPP
8 #define CPPWAMP_TYPES_SET_HPP
17 #include "../error.hpp"
18 #include "../variant.hpp"
30 const auto& variant = conv.
variant();
31 if (!variant.is<
Array>())
39 for (Array::size_type i=0; i<
array.size(); ++i)
43 newSet.emplace(
array[i].to<T>());
47 std::string msg = e.what();
48 msg +=
" (for element #" + std::to_string(i) +
")";
52 set = std::move(newSet);
63 for (
const auto& elem: set)
72 #endif // CPPWAMP_TYPES_SET_HPP
const Variant & variant() const
Returns a constant reference to the wrapped variant.
Definition: variant.hpp:1384
@ array
For Variant::Array.
Variant & variant()
Returns a reference to the wrapped variant.
Definition: variant.hpp:1208
Definition: anyhandler.hpp:36
Wrapper around a destination Variant, used for conversions.
Definition: variant.hpp:604
std::vector< Variant > Array
Variant bound type for arrays of variants.
Definition: variantdefs.hpp:51
Wrapper around a source Variant, used for conversions.
Definition: variant.hpp:650
void convert(TConverter &c, TValue &val)
General function for converting custom types to/from Variant.
Definition: variant.hpp:709
Exception type thrown when converting a Variant to an invalid type.
Definition: error.hpp:106
static Variant from(TValue &&value)
Constructs a variant from a custom type.
Definition: variant.hpp:744