[mlpack-git] master: first commit (07833dd)

gitdub at mlpack.org gitdub at mlpack.org
Sat Feb 27 11:46:49 EST 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/a2e57d617e952f1ea2fda8a23e1c6bd2f78beb6d...1bedf15126f6bd0bc93a3233914ac95486a3c0da

>---------------------------------------------------------------

commit 07833dd4046e9c9fdc8897bc07271b1a4c87e445
Author: stereomatchingkiss <stereomatchingkiss at gmail.com>
Date:   Sun Feb 28 00:46:49 2016 +0800

    first commit


>---------------------------------------------------------------

07833dd4046e9c9fdc8897bc07271b1a4c87e445
 src/mlpack/core/util/tuple_serialize.hpp | 36 ++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/src/mlpack/core/util/tuple_serialize.hpp b/src/mlpack/core/util/tuple_serialize.hpp
new file mode 100644
index 0000000..a6f7ebf
--- /dev/null
+++ b/src/mlpack/core/util/tuple_serialize.hpp
@@ -0,0 +1,36 @@
+#ifndef MLPACK_CORE_SERIALIZE_TUPLE
+#define MLPACK_CORE_SERIALIZE_TUPLE
+
+#include <mlpack/core.hpp>
+
+#include <string>
+
+namespace boost {
+namespace serialization {  
+ 
+  template<
+      size_t I, 
+      size_t Max,
+      typename Archive, 
+      typename... Args
+  >
+  typename std::enable_if<I < Max, void>::type
+  Serialize(Archive& ar, std::tuple<Args...>& t, const unsigned int /* version */)
+  {
+    ar & data::CreateNVP(std::get<I>(t), "tuple" + std::to_string(I));
+	Serialize<I+1, Max>(ar, t, 0);
+  }
+  
+  template<
+      size_t I, 
+      size_t Max,
+      typename Archive, 
+      typename... Args
+  >
+  typename std::enable_if<I == Max, void>::type 
+  Serialize(Archive&, std::tuple<Args...>&, const unsigned int /* version */)
+  {    
+  }       
+}
+}
+#endif
\ No newline at end of file




More information about the mlpack-git mailing list