1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #ifndef RTTR_ARGUMENT_WRAPPER_H_
- #define RTTR_ARGUMENT_WRAPPER_H_
- #include "rttr/detail/base/core_prerequisites.h"
- #include <memory>
- #include <type_traits>
- namespace rttr
- {
- namespace detail
- {
- struct argument_wrapper
- {
- argument_wrapper() : m_data(nullptr) {}
- template<typename T, typename Tp = typename std::enable_if<!std::is_same<T, argument_wrapper>::value, T>::type>
- argument_wrapper(T&& data) : m_data(const_cast<void*>(reinterpret_cast<const void*>(std::addressof(data)))) {}
- template<typename T>
- T& get_value() const
- {
- using raw_type = typename std::remove_reference<T>::type;
- return (*reinterpret_cast<raw_type*>(const_cast<void *>(m_data)));
- }
- void* m_data;
- };
- }
- }
- #endif
|