MCPcopy Create free account
hub / github.com/covscript/covscript / convert_helper

Class convert_helper

include/covscript/core/cni.hpp:172–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170
171 template <typename T>
172 struct convert_helper {
173 private:
174 using Bare = typename std::remove_reference<T>::type;
175 static constexpr bool IsRef = std::is_reference<T>::value;
176 static constexpr bool IsConst = std::is_const<typename std::remove_reference<T>::type>::value;
177
178 static_assert(!std::is_rvalue_reference<T>::value,
179 "convert to rvalue reference (T&&) is not allowed. Use T or T& / const T&.");
180
181 public:
182 static const Bare &get_val(any &v)
183 {
184 return v.const_val<Bare>();
185 }
186 };
187
188 template <typename T>
189 struct convert_helper<T &> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected