4#if __cplusplus>=201103L
12#include <epicsAssert.h>
14#include <pv/templateMeta.h>
15#include <pv/typeCast.h>
16#include <pv/pvIntrospect.h>
18namespace epics{
namespace pvData{
30#if __cplusplus>=201103L
32constexpr size_t cmax(
size_t A,
size_t B) {
54#if __cplusplus>=201103L
57 virtual const char* what()
const noexcept
61 virtual const char* what()
const throw()
63 {
return "bad_cast() type mis-match"; }
70#if __cplusplus>=201103L
74 detail::cmax(
alignof(std::string),
alignof(
double))
80 char data[
sizeof(std::string)];
87 typedef double _largest_blob;
91 return *
reinterpret_cast<T*
>(_wrap.blob);
94 inline const T& _as()
const {
95 return *
reinterpret_cast<const T*
>(_wrap.blob);
106 typedef typename meta::strip_const<T>::type T2;
107 typedef typename detail::any_storage_type<T2>::type TT;
109 STATIC_ASSERT(
sizeof(TT)<=
sizeof(_wrap.blob));
111 new (_wrap.blob) TT(v);
125#if __cplusplus>=201103L
138 AnyScalar(v).swap(*
this);
142#if __cplusplus>=201103L
143 inline AnyScalar&
operator=(AnyScalar&& o)
noexcept {
162 inline void* unsafe() {
return _wrap.blob; }
163 inline const void* unsafe()
const {
return _wrap.blob; }
165 inline bool empty()
const {
return _stype==(ScalarType)-1; }
167#if __cplusplus>=201103L
168 explicit operator bool()
const {
return !
empty(); }
171 typedef void (AnyScalar::*bool_type)(AnyScalar&);
173 operator bool_type()
const {
return !
empty() ? &AnyScalar::swap : 0; }
195 typedef typename meta::strip_const<T>::type T2;
196 typedef typename detail::any_storage_type<T2>::type TT;
200 return reinterpret_cast<TT&
>(_wrap.blob);
216 typedef typename meta::strip_const<T>::type T2;
217 typedef typename detail::any_storage_type<T2>::type TT;
221 return reinterpret_cast<typename meta::decorate_const<TT>::type&
>(_wrap.blob);
231 typedef typename meta::strip_const<T>::type T2;
232 typedef typename detail::any_storage_type<T2>::type TT;
247std::ostream&
operator<<(std::ostream& strm,
const AnyScalar& v);
constexpr complex< _Tp > & operator=(const _Tp &)
void swap(any &__x, any &__y) noexcept
basic_ostream< _CharT, _Traits > & operator<<(basic_ostream< _CharT, _Traits > &__os, const basic_string< _CharT, _Traits, _Alloc > &__str)
constexpr auto empty(const _Container &__cont) noexcept(noexcept(__cont.empty())) -> decltype(__cont.empty())
constexpr auto data(_Container &__cont) noexcept(noexcept(__cont.data())) -> decltype(__cont.data())
ScalarType type() const
Type code of contained value. Or (ScalarType)-1 is empty.
meta::decorate_const< typenamedetail::any_storage_type< typenamemeta::strip_const< T >::type >::type >::type & ref() const
AnyScalar(ScalarType type, const void *buf)
const void * bufferUnsafe() const
detail::any_storage_type< typenamemeta::strip_const< T >::type >::type & ref()
AnyScalar(T v)
Construct from provided value.