gtsam 4.1.1
gtsam
make_shared.h
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2
3 * GTSAM Copyright 2020, Georgia Tech Research Corporation,
4 * Atlanta, Georgia 30332-0415
5 * All Rights Reserved
6 * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7
8 * See LICENSE for the license information
9
10 * -------------------------------------------------------------------------- */
11
18#pragma once
19
20#include <gtsam/base/types.h>
21
22#include <Eigen/Core>
23
24#include <boost/make_shared.hpp>
25
26#include <type_traits>
27
28namespace gtsam {
30 template<bool B, class T = void>
31 using enable_if_t = typename std::enable_if<B, T>::type;
32}
33
34namespace gtsam {
35
56 template<typename T, typename ... Args>
58 return boost::allocate_shared<T>(Eigen::aligned_allocator<T>(), std::forward<Args>(args)...);
59 }
60
62 template<typename T, typename ... Args>
64 return boost::make_shared<T>(std::forward<Args>(args)...);
65 }
66
67}
Typedefs for easier changing of types.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
typename std::enable_if< B, T >::type enable_if_t
An shorthand alias for accessing the ::type inside std::enable_if that can be used in a template dire...
Definition: make_shared.h:31
gtsam::enable_if_t< needs_eigen_aligned_allocator< T >::value, boost::shared_ptr< T > > make_shared(Args &&... args)
Add our own make_shared as a layer of wrapping on boost::make_shared This solves the problem with the...
Definition: make_shared.h:57