Awali
Another Weighted Automata library
awali
sttc
misc
memory.hh
Go to the documentation of this file.
1
// This file is part of Awali.
2
// Copyright 2016-2022 Sylvain Lombardy, Victor Marsault, Jacques Sakarovitch
3
//
4
// Awali is a free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17
#ifndef AWALI_MISC_MEMORY_HH
18
# define AWALI_MISC_MEMORY_HH
19
20
# include <memory>
21
# include <utility>
// std::forward
22
23
namespace
awali
{
namespace
sttc {
24
27
template
<
typename
SharedPtr,
typename
... Args>
28
SharedPtr
29
make_shared_ptr
(Args&&... args)
30
{
31
using
type =
typename
SharedPtr::element_type;
32
return
std::make_shared<type>(std::forward<Args>(args)...);
33
}
34
}}
//end of ns awali::stc
35
36
#endif
// !AWALI_MISC_MEMORY_HH
awali::sttc::make_shared_ptr
SharedPtr make_shared_ptr(Args &&... args)
Same as std::make_shared, but parameterized by the shared_ptr type, not the (pointed to) element_type...
Definition:
memory.hh:29
awali
Main namespace of Awali.
Definition:
ato.hh:22
Generated on Tue Dec 20 2022 19:47:02 for Awali by
1.9.1