5 #ifndef FORBCC_SHAREABLE_H 6 #define FORBCC_SHAREABLE_H 18 using const_T =
typename std::add_const<T>::type;
21 using ptr_t = std::shared_ptr<T>;
30 template<
typename ...Args>
32 return std::make_shared<T>(args...);
37 template<
typename ...Args>
39 return std::make_shared<const_T>(args...);
46 #endif //FORBCC_SHAREABLE_H typename std::add_const< module >::type const_T
Alias to the same type T, but with const qualifier.
Definition: shareable.hpp:18
static ptr_t new_ptr(Args &&... args)
Calls the constructor of the class with the given arguments to create a shared_pointer to T...
Definition: shareable.hpp:31
std::shared_ptr< const_T > ptr_const_t
Alias to std::shared_ptr<const T>
Definition: shareable.hpp:24
A template that can be used to ease the declaration of a shared_pointer of a given type...
Definition: shareable.hpp:13
Definition: code_ostream.hpp:11
std::shared_ptr< module > ptr_t
Alias to std::shared_ptr<T>
Definition: shareable.hpp:21
static ptr_const_t new_ptr_const(Args &&... args)
Calls the constructor of the class with the given arguments to create a shared_pointer to a const T...
Definition: shareable.hpp:38