mlpack  3.4.2
is_serializable.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_BINDINGS_MARKDOWN_IS_SERIALIZABLE_HPP
13 #define MLPACK_BINDINGS_MARKDOWN_IS_SERIALIZABLE_HPP
14 
15 #include <mlpack/prereqs.hpp>
16 
17 namespace mlpack {
18 namespace bindings {
19 namespace markdown {
20 
24 template<typename T>
26  const typename boost::disable_if<data::HasSerialize<T>>::type* = 0)
27 {
28  return false;
29 }
30 
35 template<typename T>
37  const typename boost::enable_if<arma::is_arma_type<T>>::type* = 0)
38 {
39  return false;
40 }
41 
45 template<typename T>
47  const typename boost::enable_if<data::HasSerialize<T>>::type* = 0,
48  const typename boost::disable_if<arma::is_arma_type<T>>::type* = 0)
49 {
50  return true;
51 }
52 
56 template<typename T>
58  const void* /* input */,
59  void* output)
60 {
61  *((bool*) output) = IsSerializable<typename std::remove_pointer<T>::type>();
62 }
63 
64 } // namespace markdown
65 } // namespace bindings
66 } // namespace mlpack
67 
68 #endif
prereqs.hpp
The core includes that mlpack expects; standard C++ includes and Armadillo.
mlpack::util::ParamData
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:53
mlpack
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: add_to_cli11.hpp:21
mlpack::data::HasSerialize
Definition: has_serialize.hpp:46
mlpack::bindings::markdown::IsSerializable
bool IsSerializable(const typename boost::disable_if< data::HasSerialize< T >>::type *=0)
Return false, because the type is not serializable.
Definition: is_serializable.hpp:25