Closed uknys closed 6 years ago
Well I got it working by creating a new storage type like dyno::non_owning_storage
for Boost::TE.
struct viewer_storage {
template <class T, class T_ = std::decay_t<T> >
constexpr explicit viewer_storage(T &&t, te::detail::void_ptr &ptr) noexcept {
ptr.reset(&t,
[]([[maybe_unused]] void *ptr) {},
[](void *ptr) -> void * { return static_cast<T_ *>(ptr); });
}
};
Here's an example to see it working : https://wandbox.org/permlink/9rADpyr92if0Z7CI And in Compiler Explorer : https://godbolt.org/g/ERscKM
This issue is fixed with this commit #17
Hello,
I wanted to know if it was possible to use [Boost].TE with types which have no const member functions, couldn't find a way to make it work to pass it by ref.
Here's the code :
Here's the wandbox : https://wandbox.org/permlink/x3Mo2N4toRhCol2H