13
13
#include < future>
14
14
#include < chrono>
15
15
#include < boost/algorithm/string.hpp>
16
+ #include < boost/smart_ptr/local_shared_ptr.hpp>
16
17
#include < boost/optional.hpp>
17
18
#include < boost/bimap.hpp>
18
19
#include < boost/any.hpp>
@@ -70,6 +71,14 @@ namespace kit
70
71
struct is_shared_ptr <std::shared_ptr<T>> {
71
72
static bool const value = true ;
72
73
};
74
+ template <class T , class _ = void >
75
+ struct is_local_shared_ptr {
76
+ static const bool value = false ;
77
+ };
78
+ template <class T >
79
+ struct is_local_shared_ptr <boost::local_shared_ptr<T>> {
80
+ static bool const value = true ;
81
+ };
73
82
74
83
template <class T >
75
84
T mod (T a, T b)
@@ -804,6 +813,12 @@ namespace kit
804
813
{
805
814
return std::unique_ptr<T>(new T (std::forward<Args>(args)...));
806
815
}
816
+ template <class T , class ... Args>
817
+ T make (Args&&... args)
818
+ {
819
+ return T (new typename T::element_type (std::forward<Args>(args)...));
820
+ }
821
+
807
822
template <class T , class ... Args>
808
823
std::unique_ptr<T> init_unique (Args&&... args)
809
824
{
@@ -818,18 +833,18 @@ namespace kit
818
833
p->init ();
819
834
return p;
820
835
}
821
- template <class T , class ... Args>
822
- std::unique_ptr<T>& make (std::unique_ptr<T>& p, Args&&... args)
823
- {
824
- p = std::unique_ptr<T>(new T (std::forward<Args>(args)...));
825
- return p;
826
- }
827
- template <class T , class ... Args>
828
- std::shared_ptr<T>& make (std::shared_ptr<T>& p, Args&&... args)
829
- {
830
- p = std::shared_ptr<T>(new T (std::forward<Args>(args)...));
831
- return p;
832
- }
836
+ // template<class T, class... Args>
837
+ // std::unique_ptr<T>& make(std::unique_ptr<T>& p, Args&&... args)
838
+ // {
839
+ // p = std::unique_ptr<T>(new T(std::forward<Args>(args)...));
840
+ // return p;
841
+ // }
842
+ // template<class T, class... Args>
843
+ // std::shared_ptr<T>& make(std::shared_ptr<T>& p, Args&&... args)
844
+ // {
845
+ // p = std::shared_ptr<T>(new T(std::forward<Args>(args)...));
846
+ // return p;
847
+ // }
833
848
template <class T , class ... Args>
834
849
std::unique_ptr<T>& init (std::unique_ptr<T>& p, Args&&... args)
835
850
{
0 commit comments