xtd 0.2.0
new_sptr.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "sptr.hpp"
6#include <utility>
7
9namespace xtd {
23 template<class type_t, class ...args_t>
24 sptr<type_t> new_sptr(args_t&& ... args) {return sptr<type_t> {new type_t(std::forward<args_t>(args)...)};}
25
27 template<class type_t>
28 sptr<type_t> new_sptr(const type_t& arg) {return sptr<type_t> {new type_t(arg)};}
29
30 template<class type_t>
31 sptr<type_t> new_sptr() {return sptr<type_t>(new type_t);}
33}
The xtd::shared_ptr_object is a shared pointer as std::shared_ptr.
Definition shared_ptr_object.hpp:30
sptr< type_t > new_sptr(args_t &&... args)
xtd::new_sptr operator creates a xtd::sptr object.
Definition new_sptr.hpp:24
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::sptr type.