From 3740a1ac7cd9ac79e09d42a99a1bbc8e05e670d7 Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sat, 26 Jun 2021 17:05:57 +0200 Subject: [PATCH 01/19] First successful test Signed-off-by: Omar Shrit --- src/mlpack/bindings/cli/add_to_cli11.hpp | 76 ++++++++++++------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/mlpack/bindings/cli/add_to_cli11.hpp b/src/mlpack/bindings/cli/add_to_cli11.hpp index ceb03c64e2..cf117067d3 100644 --- a/src/mlpack/bindings/cli/add_to_cli11.hpp +++ b/src/mlpack/bindings/cli/add_to_cli11.hpp @@ -33,15 +33,15 @@ template void AddToCLI11(const std::string& cliName, util::ParamData& param, CLI::App& app, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if< - arma::is_arma_type>::type* = 0, - const typename boost::disable_if< - data::HasSerialize>::type* = 0, - const typename boost::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>>::type* = 0) + arma::mat>>::value>::type* = 0) { app.add_option_function(cliName.c_str(), [¶m](const std::string& value) @@ -65,15 +65,15 @@ template void AddToCLI11(const std::string& cliName, util::ParamData& param, CLI::App& app, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if< - arma::is_arma_type>::type* = 0, - const typename boost::enable_if< - data::HasSerialize>::type* = 0, - const typename boost::disable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if< + data::HasSerialize::value>::type* = 0, + const typename std::enable_if>>::type* = 0) + arma::mat>>::value>::type* = 0) { app.add_option_function(cliName.c_str(), [¶m](const std::string& value) @@ -97,13 +97,13 @@ template void AddToCLI11(const std::string& cliName, util::ParamData& param, CLI::App& app, - const typename boost::disable_if< - std::is_same>::type* = 0, - const typename boost::enable_if< - arma::is_arma_type>::type* = 0, - const typename boost::disable_if::value>::type* = 0, + const typename std::enable_if< + arma::is_arma_type::value>::type* = 0, + const typename std::enable_if>>::type* = 0) + arma::mat>>::value>::type* = 0) { app.add_option_function(cliName.c_str(), [¶m](const std::string& value) @@ -127,15 +127,15 @@ template void AddToCLI11(const std::string& cliName, util::ParamData& param, CLI::App& app, - const typename boost::disable_if< - std::is_same>::type* = 0, - const typename boost::disable_if< - arma::is_arma_type>::type* = 0, - const typename boost::disable_if< - data::HasSerialize>::type* = 0, - const typename boost::disable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>>::type* = 0) + arma::mat>>::value>::type* = 0) { app.add_option_function(cliName.c_str(), [¶m](const T& value) @@ -157,15 +157,15 @@ template void AddToCLI11(const std::string& cliName, util::ParamData& param, CLI::App& app, - const typename boost::enable_if< - std::is_same>::type* = 0, - const typename boost::disable_if< - arma::is_arma_type>::type* = 0, - const typename boost::disable_if< - data::HasSerialize>::type* = 0, - const typename boost::disable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>>::type* = 0) + arma::mat>>::value>::type* = 0) { app.add_flag_function(cliName.c_str(), [¶m](const T& value) From 93de3217f20a471c2d1e5b1611c5b64107584e7c Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sat, 26 Jun 2021 18:04:37 +0200 Subject: [PATCH 02/19] Remove half of boost in this directory Signed-off-by: Omar Shrit --- src/mlpack/bindings/cli/default_param.hpp | 20 ++++++++--------- .../bindings/cli/default_param_impl.hpp | 20 ++++++++--------- .../bindings/cli/get_printable_param.hpp | 14 ++++++------ .../bindings/cli/get_printable_param_name.hpp | 18 +++++++-------- .../cli/get_printable_param_name_impl.hpp | 18 +++++++-------- .../bindings/cli/get_printable_type_impl.hpp | 14 ++++++------ src/mlpack/bindings/cli/output_param.hpp | 22 +++++++++---------- src/mlpack/bindings/cli/output_param_impl.hpp | 22 +++++++++---------- src/mlpack/bindings/cli/print_type_doc.hpp | 14 ++++++------ .../bindings/cli/print_type_doc_impl.hpp | 14 ++++++------ 10 files changed, 88 insertions(+), 88 deletions(-) diff --git a/src/mlpack/bindings/cli/default_param.hpp b/src/mlpack/bindings/cli/default_param.hpp index 1eecd76eec..f8a7ea894c 100644 --- a/src/mlpack/bindings/cli/default_param.hpp +++ b/src/mlpack/bindings/cli/default_param.hpp @@ -26,12 +26,12 @@ namespace cli { template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Return the default value of a vector option. @@ -39,7 +39,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Return the default value of a string option. @@ -47,7 +47,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Return the default value of a matrix option, a tuple option, a @@ -69,8 +69,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Return the default value of an option. This is the function that will be diff --git a/src/mlpack/bindings/cli/default_param_impl.hpp b/src/mlpack/bindings/cli/default_param_impl.hpp index 26e9d7e6cd..db95caf008 100644 --- a/src/mlpack/bindings/cli/default_param_impl.hpp +++ b/src/mlpack/bindings/cli/default_param_impl.hpp @@ -24,12 +24,12 @@ namespace cli { template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type* /* junk */) { std::ostringstream oss; if (!std::is_same::value) @@ -44,7 +44,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */) { // Print each element in an array delimited by square brackets. std::ostringstream oss; @@ -88,7 +88,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*) { const std::string& s = *boost::any_cast(&data.value); return "'" + s + "'"; @@ -115,8 +115,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */) { return "''"; } diff --git a/src/mlpack/bindings/cli/get_printable_param.hpp b/src/mlpack/bindings/cli/get_printable_param.hpp index ca13c679e9..2cd2221101 100644 --- a/src/mlpack/bindings/cli/get_printable_param.hpp +++ b/src/mlpack/bindings/cli/get_printable_param.hpp @@ -27,11 +27,11 @@ namespace cli { template std::string GetPrintableParam( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Print a vector option, with spaces between it. @@ -57,8 +57,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Print an option into a std::string. This should print a short, one-line diff --git a/src/mlpack/bindings/cli/get_printable_param_name.hpp b/src/mlpack/bindings/cli/get_printable_param_name.hpp index 38d3c64164..b875d2f72d 100644 --- a/src/mlpack/bindings/cli/get_printable_param_name.hpp +++ b/src/mlpack/bindings/cli/get_printable_param_name.hpp @@ -26,10 +26,10 @@ namespace cli { template std::string GetPrintableParamName( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Get the parameter name for a matrix type (where the user has to pass the file @@ -38,7 +38,7 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Get the parameter name for a serializable model type (where the user has to @@ -47,8 +47,8 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Get the parameter name for a mapped matrix type (where the user has to pass @@ -57,8 +57,8 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename boost::enable_if>>::type* = 0); + const typename std::enable_if>::value>::type* = 0); /** * Get the parameter's name as seen by the user. diff --git a/src/mlpack/bindings/cli/get_printable_param_name_impl.hpp b/src/mlpack/bindings/cli/get_printable_param_name_impl.hpp index 4bb0da75e0..7c355c3dbc 100644 --- a/src/mlpack/bindings/cli/get_printable_param_name_impl.hpp +++ b/src/mlpack/bindings/cli/get_printable_param_name_impl.hpp @@ -26,10 +26,10 @@ namespace cli { template std::string GetPrintableParamName( util::ParamData& data, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "--" + data.name; } @@ -41,7 +41,7 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*) { return "--" + data.name + "_file"; } @@ -53,8 +53,8 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename boost::disable_if>::type*, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return "--" + data.name + "_file"; } @@ -66,8 +66,8 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename boost::enable_if>>::type*) + const typename std::enable_if>::value>::type*) { return "--" + data.name + "_file"; } diff --git a/src/mlpack/bindings/cli/get_printable_type_impl.hpp b/src/mlpack/bindings/cli/get_printable_type_impl.hpp index 7e7da8b038..d02dae49fc 100644 --- a/src/mlpack/bindings/cli/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/cli/get_printable_type_impl.hpp @@ -25,11 +25,11 @@ namespace cli { template std::string GetPrintableType( util::ParamData& data, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { if (std::is_same::value) return "flag"; @@ -101,8 +101,8 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename boost::disable_if>::type*, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return data.cppType + " file"; } diff --git a/src/mlpack/bindings/cli/output_param.hpp b/src/mlpack/bindings/cli/output_param.hpp index 898f2d1a39..bef23ed43e 100644 --- a/src/mlpack/bindings/cli/output_param.hpp +++ b/src/mlpack/bindings/cli/output_param.hpp @@ -26,11 +26,11 @@ namespace cli { template void OutputParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Output a vector option (print to stdout). @@ -38,7 +38,7 @@ void OutputParamImpl( template void OutputParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Output a matrix option (this saves it to the given file). @@ -46,7 +46,7 @@ void OutputParamImpl( template void OutputParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Output a serializable class option (this saves it to the given file). @@ -54,8 +54,8 @@ void OutputParamImpl( template void OutputParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Output a mapped dataset. @@ -63,8 +63,8 @@ void OutputParamImpl( template void OutputParamImpl( util::ParamData& data, - const typename boost::enable_if>>::type* = 0); + const typename std::enable_if>::value>::type* = 0); /** * Output an option. This is the function that will be called by the IO diff --git a/src/mlpack/bindings/cli/output_param_impl.hpp b/src/mlpack/bindings/cli/output_param_impl.hpp index ab2f1e8822..d34b55fd74 100644 --- a/src/mlpack/bindings/cli/output_param_impl.hpp +++ b/src/mlpack/bindings/cli/output_param_impl.hpp @@ -24,11 +24,11 @@ namespace cli { template void OutputParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if>::value>::type* /* junk */) { std::cout << data.name << ": " << *boost::any_cast(&data.value) << std::endl; @@ -38,7 +38,7 @@ void OutputParamImpl( template void OutputParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */) { std::cout << data.name << ": "; const T& t = *boost::any_cast(&data.value); @@ -51,7 +51,7 @@ void OutputParamImpl( template void OutputParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */) { typedef std::tuple> TupleType; const T& output = std::get<0>(*boost::any_cast(&data.value)); @@ -71,8 +71,8 @@ void OutputParamImpl( template void OutputParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* /* junk */, - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */) { // The const cast is necessary here because Serialize() can't ever be marked // const. In this case we can assume it though, since we will be saving and @@ -91,8 +91,8 @@ void OutputParamImpl( template void OutputParamImpl( util::ParamData& data, - const typename boost::enable_if>>::type* /* junk */) + const typename std::enable_if>::value>::type* /* junk */) { // Output the matrix with the mappings. typedef std::tuple> TupleType; diff --git a/src/mlpack/bindings/cli/print_type_doc.hpp b/src/mlpack/bindings/cli/print_type_doc.hpp index 873d5465f2..10acab4f5b 100644 --- a/src/mlpack/bindings/cli/print_type_doc.hpp +++ b/src/mlpack/bindings/cli/print_type_doc.hpp @@ -25,11 +25,11 @@ namespace cli { template std::string PrintTypeDoc( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Return a string representing the command-line type of a vector. @@ -62,8 +62,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Print the command-line type of an option into a string. diff --git a/src/mlpack/bindings/cli/print_type_doc_impl.hpp b/src/mlpack/bindings/cli/print_type_doc_impl.hpp index 51e3106de5..1836732bf8 100644 --- a/src/mlpack/bindings/cli/print_type_doc_impl.hpp +++ b/src/mlpack/bindings/cli/print_type_doc_impl.hpp @@ -24,11 +24,11 @@ namespace cli { template std::string PrintTypeDoc( util::ParamData& data, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { // A flag type. if (std::is_same::value) @@ -165,8 +165,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& /* data */, - const typename boost::disable_if>::type*, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return "A filename containing an mlpack model. These can have one of three " "formats: binary (.bin), text (.txt), and XML (.xml). The XML format " From 632b43b46717096b91eae46a008c31711bfe7db3 Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sat, 26 Jun 2021 18:54:19 +0200 Subject: [PATCH 03/19] Compiling, remove boost_enable_if entirely from CLI binding Signed-off-by: Omar Shrit --- src/mlpack/bindings/cli/default_param.hpp | 2 +- src/mlpack/bindings/cli/default_param_impl.hpp | 2 +- .../bindings/cli/delete_allocated_memory.hpp | 10 +++++----- .../bindings/cli/get_allocated_memory.hpp | 10 +++++----- src/mlpack/bindings/cli/get_param.hpp | 18 +++++++++--------- .../bindings/cli/get_printable_param_impl.hpp | 14 +++++++------- .../bindings/cli/get_printable_param_value.hpp | 18 +++++++++--------- .../cli/get_printable_param_value_impl.hpp | 18 +++++++++--------- src/mlpack/bindings/cli/get_printable_type.hpp | 14 +++++++------- src/mlpack/bindings/cli/get_raw_param.hpp | 14 +++++++------- src/mlpack/bindings/cli/map_parameter_name.hpp | 10 +++++----- src/mlpack/bindings/cli/set_param.hpp | 18 +++++++++--------- src/mlpack/bindings/cli/string_type_param.hpp | 8 ++++---- .../bindings/cli/string_type_param_impl.hpp | 8 ++++---- 14 files changed, 82 insertions(+), 82 deletions(-) diff --git a/src/mlpack/bindings/cli/default_param.hpp b/src/mlpack/bindings/cli/default_param.hpp index f8a7ea894c..093a03c567 100644 --- a/src/mlpack/bindings/cli/default_param.hpp +++ b/src/mlpack/bindings/cli/default_param.hpp @@ -57,7 +57,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if_c< + const typename std::enable_if< arma::is_arma_type::value || std::is_same>::value>::type* /* junk */ = 0); diff --git a/src/mlpack/bindings/cli/default_param_impl.hpp b/src/mlpack/bindings/cli/default_param_impl.hpp index db95caf008..b002e94611 100644 --- a/src/mlpack/bindings/cli/default_param_impl.hpp +++ b/src/mlpack/bindings/cli/default_param_impl.hpp @@ -100,7 +100,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename boost::enable_if_c< + const typename std::enable_if< arma::is_arma_type::value || std::is_same>::value>::type* /* junk */) diff --git a/src/mlpack/bindings/cli/delete_allocated_memory.hpp b/src/mlpack/bindings/cli/delete_allocated_memory.hpp index 35d305bb99..f3123c52e8 100644 --- a/src/mlpack/bindings/cli/delete_allocated_memory.hpp +++ b/src/mlpack/bindings/cli/delete_allocated_memory.hpp @@ -21,8 +21,8 @@ namespace cli { template void DeleteAllocatedMemoryImpl( util::ParamData& /* d */, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // Do nothing. } @@ -30,7 +30,7 @@ void DeleteAllocatedMemoryImpl( template void DeleteAllocatedMemoryImpl( util::ParamData& /* d */, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { // Do nothing. } @@ -38,8 +38,8 @@ void DeleteAllocatedMemoryImpl( template void DeleteAllocatedMemoryImpl( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // Delete the allocated memory (hopefully we actually own it). typedef std::tuple TupleType; diff --git a/src/mlpack/bindings/cli/get_allocated_memory.hpp b/src/mlpack/bindings/cli/get_allocated_memory.hpp index 0f70fe0adf..08e97e1e39 100644 --- a/src/mlpack/bindings/cli/get_allocated_memory.hpp +++ b/src/mlpack/bindings/cli/get_allocated_memory.hpp @@ -22,8 +22,8 @@ namespace cli { template void* GetAllocatedMemory( util::ParamData& /* d */, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { return NULL; } @@ -31,7 +31,7 @@ void* GetAllocatedMemory( template void* GetAllocatedMemory( util::ParamData& /* d */, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { return NULL; } @@ -39,8 +39,8 @@ void* GetAllocatedMemory( template void* GetAllocatedMemory( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // Here we have a model, which is a tuple, and we need the address of the // memory. diff --git a/src/mlpack/bindings/cli/get_param.hpp b/src/mlpack/bindings/cli/get_param.hpp index d401e0e554..34463e939c 100644 --- a/src/mlpack/bindings/cli/get_param.hpp +++ b/src/mlpack/bindings/cli/get_param.hpp @@ -28,10 +28,10 @@ namespace cli { template T& GetParam( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { // No mapping is needed, so just cast it directly. return *boost::any_cast(&d.value); @@ -45,7 +45,7 @@ T& GetParam( template T& GetParam( util::ParamData& d, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { // If the matrix is an input matrix, we have to load the matrix. 'value' // contains the filename. It's possible we could load empty matrices many @@ -80,8 +80,8 @@ T& GetParam( template T& GetParam( util::ParamData& d, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if>::value>::type* = 0) { // If this is an input parameter, we need to load both the matrix and the // dataset info. @@ -110,8 +110,8 @@ T& GetParam( template T*& GetParam( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // If the model is an input model, we have to load it from file. 'value' // contains the filename. diff --git a/src/mlpack/bindings/cli/get_printable_param_impl.hpp b/src/mlpack/bindings/cli/get_printable_param_impl.hpp index 9898c49ee6..89f3c066f0 100644 --- a/src/mlpack/bindings/cli/get_printable_param_impl.hpp +++ b/src/mlpack/bindings/cli/get_printable_param_impl.hpp @@ -23,11 +23,11 @@ namespace cli { template std::string GetPrintableParam( util::ParamData& data, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if>::value>::type* /* junk */) { std::ostringstream oss; oss << boost::any_cast(data.value); @@ -103,8 +103,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::disable_if>::type* /* junk */, - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */) { // Extract the string from the tuple that's being held. typedef std::tuple::type> TupleType; diff --git a/src/mlpack/bindings/cli/get_printable_param_value.hpp b/src/mlpack/bindings/cli/get_printable_param_value.hpp index 208afdb87b..621640b3c1 100644 --- a/src/mlpack/bindings/cli/get_printable_param_value.hpp +++ b/src/mlpack/bindings/cli/get_printable_param_value.hpp @@ -27,10 +27,10 @@ template std::string GetPrintableParamValue( util::ParamData& data, const std::string& value, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Get the parameter name for a matrix type (where the user has to pass the file @@ -40,7 +40,7 @@ template std::string GetPrintableParamValue( util::ParamData& data, const std::string& value, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Get the parameter name for a serializable model type (where the user has to @@ -50,8 +50,8 @@ template std::string GetPrintableParamValue( util::ParamData& data, const std::string& value, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Get the parameter name for a mapped matrix type (where the user has to pass @@ -61,8 +61,8 @@ template std::string GetPrintableParamValue( util::ParamData& data, const std::string& value, - const typename boost::enable_if>>::type* = 0); + const typename std::enable_if>::value>::type* = 0); /** * Get the parameter's name as seen by the user. diff --git a/src/mlpack/bindings/cli/get_printable_param_value_impl.hpp b/src/mlpack/bindings/cli/get_printable_param_value_impl.hpp index 09389614a1..3bb42b01b1 100644 --- a/src/mlpack/bindings/cli/get_printable_param_value_impl.hpp +++ b/src/mlpack/bindings/cli/get_printable_param_value_impl.hpp @@ -28,10 +28,10 @@ template std::string GetPrintableParamValue( util::ParamData& /* data */, const std::string& input, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return input; } @@ -44,7 +44,7 @@ template std::string GetPrintableParamValue( util::ParamData& /* data */, const std::string& input, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*) { return input + ".csv"; } @@ -57,8 +57,8 @@ template std::string GetPrintableParamValue( util::ParamData& /* data */, const std::string& input, - const typename boost::disable_if>::type*, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return input + ".bin"; } @@ -71,8 +71,8 @@ template std::string GetPrintableParamValue( util::ParamData& /* data */, const std::string& input, - const typename boost::enable_if>>::type*) + const typename std::enable_if>::value>::type*) { return input + ".arff"; } diff --git a/src/mlpack/bindings/cli/get_printable_type.hpp b/src/mlpack/bindings/cli/get_printable_type.hpp index 9c29711240..07fd10609a 100644 --- a/src/mlpack/bindings/cli/get_printable_type.hpp +++ b/src/mlpack/bindings/cli/get_printable_type.hpp @@ -23,11 +23,11 @@ namespace cli { template std::string GetPrintableType( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Return a string representing the command-line type of a vector. @@ -60,8 +60,8 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Print the command-line type of an option into a string. diff --git a/src/mlpack/bindings/cli/get_raw_param.hpp b/src/mlpack/bindings/cli/get_raw_param.hpp index 46c3956a1f..38b340387e 100644 --- a/src/mlpack/bindings/cli/get_raw_param.hpp +++ b/src/mlpack/bindings/cli/get_raw_param.hpp @@ -27,10 +27,10 @@ namespace cli { template T& GetRawParam( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { // No mapping is needed, so just cast it directly. return *boost::any_cast(&d.value); @@ -42,7 +42,7 @@ T& GetRawParam( template T& GetRawParam( util::ParamData& d, - const typename boost::enable_if_c< + const typename std::enable_if< arma::is_arma_type::value || std::is_same>::value>::type* = 0) @@ -59,8 +59,8 @@ T& GetRawParam( template T*& GetRawParam( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // Don't load the model. typedef std::tuple TupleType; diff --git a/src/mlpack/bindings/cli/map_parameter_name.hpp b/src/mlpack/bindings/cli/map_parameter_name.hpp index 1835bd5602..74f20a6431 100644 --- a/src/mlpack/bindings/cli/map_parameter_name.hpp +++ b/src/mlpack/bindings/cli/map_parameter_name.hpp @@ -27,10 +27,10 @@ namespace cli { template std::string MapParameterName( const std::string& identifier, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { return identifier; } @@ -43,7 +43,7 @@ std::string MapParameterName( template std::string MapParameterName( const std::string& identifier, - const typename boost::enable_if_c< + const typename std::enable_if< arma::is_arma_type::value || std::is_same>::value || diff --git a/src/mlpack/bindings/cli/set_param.hpp b/src/mlpack/bindings/cli/set_param.hpp index f800fe0553..f76f058d2e 100644 --- a/src/mlpack/bindings/cli/set_param.hpp +++ b/src/mlpack/bindings/cli/set_param.hpp @@ -27,11 +27,11 @@ template void SetParam( util::ParamData& d, const boost::any& value, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0, - const typename boost::disable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // No mapping is needed. d.value = value; @@ -44,7 +44,7 @@ template void SetParam( util::ParamData& d, const boost::any& /* value */, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { // Force set to the value of whether or not this was passed. d.value = d.wasPassed; @@ -60,7 +60,7 @@ void SetParam( const boost::any& value, const typename std::enable_if::value || std::is_same>::value>::type* = 0) + std::tuple>::value::value>::type* = 0) { // We're setting the string filename. typedef std::tuple::type> TupleType; @@ -76,8 +76,8 @@ template void SetParam( util::ParamData& d, const boost::any& value, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // We're setting the string filename. typedef std::tuple::type> TupleType; diff --git a/src/mlpack/bindings/cli/string_type_param.hpp b/src/mlpack/bindings/cli/string_type_param.hpp index eb4550e3ca..decf9e794d 100644 --- a/src/mlpack/bindings/cli/string_type_param.hpp +++ b/src/mlpack/bindings/cli/string_type_param.hpp @@ -26,22 +26,22 @@ namespace cli { */ template std::string StringTypeParamImpl( - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Return a string containing the type of the parameter, for vector options. */ template std::string StringTypeParamImpl( - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Return a string containing the type of the parameter, */ template std::string StringTypeParamImpl( - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Return a string containing the type of a parameter. This overload is used if diff --git a/src/mlpack/bindings/cli/string_type_param_impl.hpp b/src/mlpack/bindings/cli/string_type_param_impl.hpp index 7bf1df6516..195d1b5a3b 100644 --- a/src/mlpack/bindings/cli/string_type_param_impl.hpp +++ b/src/mlpack/bindings/cli/string_type_param_impl.hpp @@ -23,8 +23,8 @@ namespace cli { */ template std::string StringTypeParamImpl( - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */) { // Don't know what type this is. return "unknown"; @@ -35,7 +35,7 @@ std::string StringTypeParamImpl( */ template std::string StringTypeParamImpl( - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */) { return "vector"; } @@ -45,7 +45,7 @@ std::string StringTypeParamImpl( */ template std::string StringTypeParamImpl( - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */) { return "string"; } From 88ddd5baf470428aba2213c3a3edef72416f96b0 Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sat, 26 Jun 2021 19:38:24 +0200 Subject: [PATCH 04/19] Yeah, markdown have changed now Signed-off-by: Omar Shrit --- .../bindings/cli/get_printable_type_impl.hpp | 2 +- .../bindings/markdown/get_printable_param.hpp | 22 +++++++++---------- .../markdown/get_printable_param_name.hpp | 18 +++++++-------- .../get_printable_param_name_impl.hpp | 18 +++++++-------- .../markdown/get_printable_param_value.hpp | 18 +++++++-------- .../get_printable_param_value_impl.hpp | 18 +++++++-------- .../bindings/markdown/is_serializable.hpp | 6 ++--- 7 files changed, 51 insertions(+), 51 deletions(-) diff --git a/src/mlpack/bindings/cli/get_printable_type_impl.hpp b/src/mlpack/bindings/cli/get_printable_type_impl.hpp index d02dae49fc..14a259b8b6 100644 --- a/src/mlpack/bindings/cli/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/cli/get_printable_type_impl.hpp @@ -101,7 +101,7 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, const typename std::enable_if::value>::type*) { return data.cppType + " file"; diff --git a/src/mlpack/bindings/markdown/get_printable_param.hpp b/src/mlpack/bindings/markdown/get_printable_param.hpp index 91df84d61f..e94e9a7ca9 100644 --- a/src/mlpack/bindings/markdown/get_printable_param.hpp +++ b/src/mlpack/bindings/markdown/get_printable_param.hpp @@ -25,11 +25,11 @@ namespace markdown { template std::string GetPrintableParam( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { std::ostringstream oss; oss << boost::any_cast(data.value); @@ -42,7 +42,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { const T& t = boost::any_cast(data.value); @@ -58,7 +58,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { // Get the matrix. const T& matrix = boost::any_cast(data.value); @@ -74,8 +74,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { std::ostringstream oss; oss << data.cppType << " model at " << boost::any_cast(data.value); @@ -88,8 +88,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if>::value>::type* = 0) { // Get the matrix. const T& tuple = boost::any_cast(data.value); diff --git a/src/mlpack/bindings/markdown/get_printable_param_name.hpp b/src/mlpack/bindings/markdown/get_printable_param_name.hpp index 9d19c05f6d..c222ea10fd 100644 --- a/src/mlpack/bindings/markdown/get_printable_param_name.hpp +++ b/src/mlpack/bindings/markdown/get_printable_param_name.hpp @@ -26,10 +26,10 @@ namespace markdown { template std::string GetPrintableParamName( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Get the parameter name for a matrix type (where the user has to pass the file @@ -38,7 +38,7 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Get the parameter name for a serializable model type (where the user has to @@ -47,8 +47,8 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Get the parameter name for a mapped matrix type (where the user has to pass @@ -57,8 +57,8 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename boost::enable_if>>::type* = 0); + const typename std::enable_if>::value>::type* = 0); /** * Get the parameter's name as seen by the user. diff --git a/src/mlpack/bindings/markdown/get_printable_param_name_impl.hpp b/src/mlpack/bindings/markdown/get_printable_param_name_impl.hpp index 5a7a63a001..b7e9f91fac 100644 --- a/src/mlpack/bindings/markdown/get_printable_param_name_impl.hpp +++ b/src/mlpack/bindings/markdown/get_printable_param_name_impl.hpp @@ -26,10 +26,10 @@ namespace markdown { template std::string GetPrintableParamName( util::ParamData& data, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "--" + data.name; } @@ -41,7 +41,7 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*) { return "--" + data.name + "_file"; } @@ -53,8 +53,8 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename boost::disable_if>::type*, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return "--" + data.name + "_file"; } @@ -66,8 +66,8 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename boost::enable_if>>::type*) + const typename std::enable_if>::value>::type*) { return "--" + data.name + "_file"; } diff --git a/src/mlpack/bindings/markdown/get_printable_param_value.hpp b/src/mlpack/bindings/markdown/get_printable_param_value.hpp index c7e44ebd07..a0708fc2af 100644 --- a/src/mlpack/bindings/markdown/get_printable_param_value.hpp +++ b/src/mlpack/bindings/markdown/get_printable_param_value.hpp @@ -27,10 +27,10 @@ template std::string GetPrintableParamValue( util::ParamData& data, const std::string& value, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Get the parameter name for a matrix type (where the user has to pass the file @@ -40,7 +40,7 @@ template std::string GetPrintableParamValue( util::ParamData& data, const std::string& value, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Get the parameter name for a serializable model type (where the user has to @@ -50,8 +50,8 @@ template std::string GetPrintableParamValue( util::ParamData& data, const std::string& value, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Get the parameter name for a mapped matrix type (where the user has to pass @@ -61,8 +61,8 @@ template std::string GetPrintableParamValue( util::ParamData& data, const std::string& value, - const typename boost::enable_if>>::type* = 0); + const typename std::enable_if>::value>::type* = 0); /** * Get the parameter's name as seen by the user. diff --git a/src/mlpack/bindings/markdown/get_printable_param_value_impl.hpp b/src/mlpack/bindings/markdown/get_printable_param_value_impl.hpp index 22da560948..0753a7b03e 100644 --- a/src/mlpack/bindings/markdown/get_printable_param_value_impl.hpp +++ b/src/mlpack/bindings/markdown/get_printable_param_value_impl.hpp @@ -28,10 +28,10 @@ template std::string GetPrintableParamValue( util::ParamData& /* data */, const std::string& input, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return input; } @@ -44,7 +44,7 @@ template std::string GetPrintableParamValue( util::ParamData& /* data */, const std::string& input, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*) { return input + ".csv"; } @@ -57,8 +57,8 @@ template std::string GetPrintableParamValue( util::ParamData& /* data */, const std::string& input, - const typename boost::disable_if>::type*, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return input + ".bin"; } @@ -71,8 +71,8 @@ template std::string GetPrintableParamValue( util::ParamData& /* data */, const std::string& input, - const typename boost::enable_if>>::type*) + const typename std::enable_if>::value>::type*) { return input + ".arff"; } diff --git a/src/mlpack/bindings/markdown/is_serializable.hpp b/src/mlpack/bindings/markdown/is_serializable.hpp index daeda8e9cb..fa66d53f08 100644 --- a/src/mlpack/bindings/markdown/is_serializable.hpp +++ b/src/mlpack/bindings/markdown/is_serializable.hpp @@ -25,7 +25,7 @@ namespace markdown { */ template bool IsSerializable( - const typename boost::disable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { return false; } @@ -35,8 +35,8 @@ bool IsSerializable( */ template bool IsSerializable( - const typename boost::enable_if>::type* = 0, - const typename boost::disable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { return true; } From 20e114a8248732fe5718c2028e4a671c4ed6da83 Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sat, 26 Jun 2021 20:31:18 +0200 Subject: [PATCH 05/19] Yeah, Julia bindings too. Signed-off-by: Omar Shrit --- src/mlpack/bindings/julia/default_param.hpp | 24 +++++++++---------- .../bindings/julia/default_param_impl.hpp | 22 ++++++++--------- .../bindings/julia/get_printable_param.hpp | 22 ++++++++--------- .../bindings/julia/get_printable_type.hpp | 14 +++++------ .../julia/get_printable_type_impl.hpp | 14 +++++------ .../bindings/julia/print_type_doc_impl.hpp | 14 +++++------ 6 files changed, 55 insertions(+), 55 deletions(-) diff --git a/src/mlpack/bindings/julia/default_param.hpp b/src/mlpack/bindings/julia/default_param.hpp index 4c61cec7e6..fca7d4a488 100644 --- a/src/mlpack/bindings/julia/default_param.hpp +++ b/src/mlpack/bindings/julia/default_param.hpp @@ -26,12 +26,12 @@ namespace julia { template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Return the default value of a vector option. @@ -39,7 +39,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Return the default value of a string option. @@ -47,7 +47,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Return the default value of a matrix option, a tuple option, a @@ -57,10 +57,10 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if_c< + const typename std::enable_if< arma::is_arma_type::value || std::is_same>::value>::type* /* junk */ = 0); + arma::mat>>::value>::type* = 0); /** * Return the default value of a model option (this returns the default @@ -69,8 +69,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Return the default value of an option. This is the function that will be diff --git a/src/mlpack/bindings/julia/default_param_impl.hpp b/src/mlpack/bindings/julia/default_param_impl.hpp index 9b975989e1..f1a71e7cf2 100644 --- a/src/mlpack/bindings/julia/default_param_impl.hpp +++ b/src/mlpack/bindings/julia/default_param_impl.hpp @@ -24,12 +24,12 @@ namespace julia { template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type* /* junk */) { std::ostringstream oss; if (std::is_same::value) @@ -46,7 +46,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */) { // Print each element in an array delimited by square brackets. std::ostringstream oss; @@ -89,7 +89,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*) { const std::string& s = *boost::any_cast(&data.value); return "\"" + s + "\""; @@ -102,7 +102,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename boost::enable_if_c< + const typename std::enable_if< arma::is_arma_type::value || std::is_same>::value>::type* /* junk */) @@ -134,8 +134,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */) { return "nothing"; } diff --git a/src/mlpack/bindings/julia/get_printable_param.hpp b/src/mlpack/bindings/julia/get_printable_param.hpp index a7c241857e..f6e7e442bc 100644 --- a/src/mlpack/bindings/julia/get_printable_param.hpp +++ b/src/mlpack/bindings/julia/get_printable_param.hpp @@ -25,11 +25,11 @@ namespace julia { template std::string GetPrintableParam( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { std::ostringstream oss; oss << boost::any_cast(data.value); @@ -42,7 +42,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { const T& t = boost::any_cast(data.value); @@ -58,7 +58,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { // Get the matrix. const T& matrix = boost::any_cast(data.value); @@ -74,8 +74,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { std::ostringstream oss; oss << data.cppType << " model at " << boost::any_cast(data.value); @@ -88,8 +88,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if>::value>::type* = 0) { // Get the matrix. const T& tuple = boost::any_cast(data.value); diff --git a/src/mlpack/bindings/julia/get_printable_type.hpp b/src/mlpack/bindings/julia/get_printable_type.hpp index 5d4a24c3ee..9fa2a03fec 100644 --- a/src/mlpack/bindings/julia/get_printable_type.hpp +++ b/src/mlpack/bindings/julia/get_printable_type.hpp @@ -23,11 +23,11 @@ namespace julia { template std::string GetPrintableType( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Return a string representing the command-line type of a vector. @@ -60,8 +60,8 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Print the command-line type of an option into a string. diff --git a/src/mlpack/bindings/julia/get_printable_type_impl.hpp b/src/mlpack/bindings/julia/get_printable_type_impl.hpp index f11c92dd8c..bbf32869b2 100644 --- a/src/mlpack/bindings/julia/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/julia/get_printable_type_impl.hpp @@ -26,11 +26,11 @@ namespace julia { template std::string GetPrintableType( util::ParamData& data, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { if (std::is_same::value) return "Bool"; @@ -102,8 +102,8 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename boost::disable_if>::type*, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { std::string type = util::StripType(data.cppType); if (type == "mlpackModel") diff --git a/src/mlpack/bindings/julia/print_type_doc_impl.hpp b/src/mlpack/bindings/julia/print_type_doc_impl.hpp index 7e6da1f606..6b72612f69 100644 --- a/src/mlpack/bindings/julia/print_type_doc_impl.hpp +++ b/src/mlpack/bindings/julia/print_type_doc_impl.hpp @@ -24,11 +24,11 @@ namespace julia { template std::string PrintTypeDoc( util::ParamData& data, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { // A flag type. if (std::is_same::value) @@ -153,8 +153,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& /* data */, - const typename boost::disable_if>::type*, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return "An mlpack model pointer. `` refers to the type of model that " "is being stored, so, e.g., for `CF()`, the type will be `CFModel`. " From 7e6dea54968857e68625708f7a73353f5ee28d83 Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sat, 26 Jun 2021 20:37:52 +0200 Subject: [PATCH 06/19] Ooops, a missing file Signed-off-by: Omar Shrit --- src/mlpack/bindings/julia/print_type_doc.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mlpack/bindings/julia/print_type_doc.hpp b/src/mlpack/bindings/julia/print_type_doc.hpp index 407fa3ee1d..eabda5a067 100644 --- a/src/mlpack/bindings/julia/print_type_doc.hpp +++ b/src/mlpack/bindings/julia/print_type_doc.hpp @@ -25,11 +25,11 @@ namespace julia { template std::string PrintTypeDoc( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Return a string representing the command-line type of a vector. @@ -62,8 +62,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Print the command-line type of an option into a string. From 863c5672e5a7f7c8272d15d752d8088a48293508 Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sun, 27 Jun 2021 16:29:36 +0200 Subject: [PATCH 07/19] Add the R bindings Signed-off-by: Omar Shrit --- src/mlpack/bindings/R/default_param.hpp | 22 ++--- src/mlpack/bindings/R/default_param_impl.hpp | 22 ++--- src/mlpack/bindings/R/get_printable_param.hpp | 22 ++--- src/mlpack/bindings/R/get_printable_type.hpp | 84 +++++++++---------- .../bindings/R/get_printable_type_impl.hpp | 84 +++++++++---------- src/mlpack/bindings/R/get_r_type.hpp | 76 ++++++++--------- src/mlpack/bindings/R/get_type.hpp | 80 +++++++++--------- .../bindings/R/print_input_processing.hpp | 18 ++-- .../bindings/R/print_output_processing.hpp | 18 ++-- src/mlpack/bindings/R/print_type_doc.hpp | 20 ++--- src/mlpack/bindings/R/print_type_doc_impl.hpp | 20 ++--- 11 files changed, 233 insertions(+), 233 deletions(-) diff --git a/src/mlpack/bindings/R/default_param.hpp b/src/mlpack/bindings/R/default_param.hpp index 4d50eb16f5..8fdf41dfbf 100644 --- a/src/mlpack/bindings/R/default_param.hpp +++ b/src/mlpack/bindings/R/default_param.hpp @@ -26,12 +26,12 @@ namespace r { template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Return the default value of a vector option. @@ -39,7 +39,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Return the default value of a string option. @@ -47,7 +47,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Return the default value of a matrix option, a tuple option, a @@ -57,7 +57,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if_c< + const typename std::enable_if< arma::is_arma_type::value || std::is_same>::value>::type* /* junk */ = 0); @@ -69,8 +69,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Return the default value of an option. This is the function that will be diff --git a/src/mlpack/bindings/R/default_param_impl.hpp b/src/mlpack/bindings/R/default_param_impl.hpp index de529d011a..751834baca 100644 --- a/src/mlpack/bindings/R/default_param_impl.hpp +++ b/src/mlpack/bindings/R/default_param_impl.hpp @@ -24,12 +24,12 @@ namespace r { template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type* /* junk */) { std::ostringstream oss; if (std::is_same::value) @@ -46,7 +46,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */) { // Print each element in an array delimited by square brackets. std::ostringstream oss; @@ -89,7 +89,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*) { const std::string& s = *boost::any_cast(&data.value); return "\"" + s + "\""; @@ -102,7 +102,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename boost::enable_if_c< + const typename std::enable_if< arma::is_arma_type::value || std::is_same>::value>::type* /* junk */) @@ -132,8 +132,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */) { return "NA"; } diff --git a/src/mlpack/bindings/R/get_printable_param.hpp b/src/mlpack/bindings/R/get_printable_param.hpp index b76d62efa8..261d363642 100644 --- a/src/mlpack/bindings/R/get_printable_param.hpp +++ b/src/mlpack/bindings/R/get_printable_param.hpp @@ -25,11 +25,11 @@ namespace r { template std::string GetPrintableParam( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { std::ostringstream oss; oss << boost::any_cast(data.value); @@ -42,7 +42,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { const T& t = boost::any_cast(data.value); @@ -58,7 +58,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { // Get the matrix. const T& matrix = boost::any_cast(data.value); @@ -74,8 +74,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { std::ostringstream oss; oss << data.cppType << " model at " << boost::any_cast(data.value); @@ -88,8 +88,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if>::value>::type* = 0) { // Get the matrix. const T& tuple = boost::any_cast(data.value); diff --git a/src/mlpack/bindings/R/get_printable_type.hpp b/src/mlpack/bindings/R/get_printable_type.hpp index 730422cade..4b19c21cdf 100644 --- a/src/mlpack/bindings/R/get_printable_type.hpp +++ b/src/mlpack/bindings/R/get_printable_type.hpp @@ -23,84 +23,84 @@ namespace r { template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*); + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*); + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*); + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*); + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*); + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*); template inline std::string GetPrintableType( util::ParamData& d, - const typename boost::enable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::enable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::enable_if>>::type* = 0); + const typename std::enable_if>::value>::type* = 0); template inline std::string GetPrintableType( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); template void GetPrintableType(util::ParamData& d, diff --git a/src/mlpack/bindings/R/get_printable_type_impl.hpp b/src/mlpack/bindings/R/get_printable_type_impl.hpp index cedecdf2ab..a163a615f5 100644 --- a/src/mlpack/bindings/R/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/R/get_printable_type_impl.hpp @@ -22,11 +22,11 @@ namespace r { template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "unknown"; } @@ -34,11 +34,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "integer"; } @@ -46,11 +46,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "numeric"; } @@ -58,11 +58,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "character"; } @@ -70,11 +70,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "integer"; } @@ -82,11 +82,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "logical"; } @@ -94,9 +94,9 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& d, - const typename boost::enable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "vector of " + GetPrintableType(d) + "s"; } @@ -104,9 +104,9 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::enable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { std::string type = "numeric matrix"; if (std::is_same::value) @@ -127,8 +127,8 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::enable_if>>::type*) + const typename std::enable_if>::value>::type*) { return "categorical matrix/data.frame"; } @@ -136,10 +136,10 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& d, - const typename boost::disable_if>::type*, - const typename boost::enable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { std::string type = util::StripType(d.cppType); if (type == "mlpackModel") diff --git a/src/mlpack/bindings/R/get_r_type.hpp b/src/mlpack/bindings/R/get_r_type.hpp index a32995dbca..d01559ea66 100644 --- a/src/mlpack/bindings/R/get_r_type.hpp +++ b/src/mlpack/bindings/R/get_r_type.hpp @@ -23,11 +23,11 @@ namespace r { template inline std::string GetRType( util::ParamData& /* d */, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { return "unknown"; } @@ -35,11 +35,11 @@ inline std::string GetRType( template<> inline std::string GetRType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "logical"; } @@ -47,11 +47,11 @@ inline std::string GetRType( template<> inline std::string GetRType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "integer"; } @@ -59,11 +59,11 @@ inline std::string GetRType( template<> inline std::string GetRType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "integer"; } @@ -71,11 +71,11 @@ inline std::string GetRType( template<> inline std::string GetRType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "numeric"; } @@ -83,11 +83,11 @@ inline std::string GetRType( template<> inline std::string GetRType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "character"; } @@ -95,7 +95,7 @@ inline std::string GetRType( template inline std::string GetRType( util::ParamData& d, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { return GetRType(d) + " vector"; } @@ -103,9 +103,9 @@ inline std::string GetRType( template inline std::string GetRType( util::ParamData& d, - const typename boost::disable_if>>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if>::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { std::string elemType = GetRType(d); std::string type = "matrix"; @@ -120,8 +120,8 @@ inline std::string GetRType( template inline std::string GetRType( util::ParamData& /* d */, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if>::value>::type* = 0) { return "numeric matrix/data.frame with info"; } @@ -129,8 +129,8 @@ inline std::string GetRType( template inline std::string GetRType( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { return util::StripType(d.cppType); } diff --git a/src/mlpack/bindings/R/get_type.hpp b/src/mlpack/bindings/R/get_type.hpp index 0437fefab0..574ec6674c 100644 --- a/src/mlpack/bindings/R/get_type.hpp +++ b/src/mlpack/bindings/R/get_type.hpp @@ -24,11 +24,11 @@ namespace r { template inline std::string GetType( util::ParamData& /* d */, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { return "unknown"; } @@ -36,11 +36,11 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "Int"; } @@ -48,11 +48,11 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "Float"; } @@ -60,11 +60,11 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "Double"; } @@ -72,11 +72,11 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "String"; } @@ -84,11 +84,11 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "Bool"; } @@ -96,9 +96,9 @@ inline std::string GetType( template inline std::string GetType( util::ParamData& d, - const typename boost::enable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { return "Vec" + GetType(d); } @@ -106,9 +106,9 @@ inline std::string GetType( template inline std::string GetType( util::ParamData& /* d */, - const typename boost::enable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { std::string type = ""; if (std::is_same::value) @@ -136,8 +136,8 @@ inline std::string GetType( template inline std::string GetType( util::ParamData& /* d */, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if>::value>::type* = 0) { return "MatWithInfo"; } @@ -145,8 +145,8 @@ inline std::string GetType( template inline std::string GetType( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { return d.cppType; } diff --git a/src/mlpack/bindings/R/print_input_processing.hpp b/src/mlpack/bindings/R/print_input_processing.hpp index 4565a6d503..34d10d5b1a 100644 --- a/src/mlpack/bindings/R/print_input_processing.hpp +++ b/src/mlpack/bindings/R/print_input_processing.hpp @@ -26,10 +26,10 @@ namespace r { template void PrintInputProcessing( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { if (!d.required) { @@ -72,7 +72,7 @@ void PrintInputProcessing( template void PrintInputProcessing( util::ParamData& d, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { if (!d.required) { @@ -108,8 +108,8 @@ void PrintInputProcessing( template void PrintInputProcessing( util::ParamData& d, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if>::value>::type* = 0) { if (!d.required) { @@ -155,8 +155,8 @@ void PrintInputProcessing( template void PrintInputProcessing( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { if (!d.required) { diff --git a/src/mlpack/bindings/R/print_output_processing.hpp b/src/mlpack/bindings/R/print_output_processing.hpp index 3345f6e437..77c6e4451c 100644 --- a/src/mlpack/bindings/R/print_output_processing.hpp +++ b/src/mlpack/bindings/R/print_output_processing.hpp @@ -26,10 +26,10 @@ namespace r { template void PrintOutputProcessing( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { /** * This gives us code like: @@ -48,7 +48,7 @@ void PrintOutputProcessing( template void PrintOutputProcessing( util::ParamData& d, - const typename boost::enable_if>::type* = 0, + const typename std::enable_if::value>::type* = 0, const typename std::enable_if>::value>::type* = 0) { @@ -69,8 +69,8 @@ void PrintOutputProcessing( template void PrintOutputProcessing( util::ParamData& d, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if>::value>::type* = 0) { /** * This gives us code like: @@ -89,8 +89,8 @@ void PrintOutputProcessing( template void PrintOutputProcessing( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { /** * This gives us code like: diff --git a/src/mlpack/bindings/R/print_type_doc.hpp b/src/mlpack/bindings/R/print_type_doc.hpp index c6b37ce1e4..92bbd07dbe 100644 --- a/src/mlpack/bindings/R/print_type_doc.hpp +++ b/src/mlpack/bindings/R/print_type_doc.hpp @@ -25,11 +25,11 @@ namespace r { template std::string PrintTypeDoc( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Return a string representing the command-line type of a vector. @@ -37,7 +37,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const typename std::enable_if::value::value>::type* = 0); /** * Return a string representing the command-line type of a matrix option. @@ -45,7 +45,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const typename std::enable_if::value::value>::type* = 0); /** * Return a string representing the command-line type of a matrix tuple option. @@ -54,7 +54,7 @@ template std::string PrintTypeDoc( util::ParamData& data, const typename std::enable_if>::value>::type* = 0); + std::tuple>::value::value>::type* = 0); /** * Return a string representing the command-line type of a model. @@ -62,8 +62,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Print the command-line type of an option into a string. diff --git a/src/mlpack/bindings/R/print_type_doc_impl.hpp b/src/mlpack/bindings/R/print_type_doc_impl.hpp index b2b87bdbdd..79c03bed48 100644 --- a/src/mlpack/bindings/R/print_type_doc_impl.hpp +++ b/src/mlpack/bindings/R/print_type_doc_impl.hpp @@ -24,11 +24,11 @@ namespace r { template std::string PrintTypeDoc( util::ParamData& data, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { // A flag type. if (std::is_same::value) @@ -64,7 +64,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type*) + const typename std::enable_if::value::value>::type*) { if (std::is_same>::value) { @@ -86,7 +86,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type*) + const typename std::enable_if::value::value>::type*) { if (std::is_same::value) { @@ -129,7 +129,7 @@ template std::string PrintTypeDoc( util::ParamData& /* data */, const typename std::enable_if>::value>::type*) + std::tuple>::value::value>::type*) { return "A 2-d array containing `numeric` data. Like the regular 2-d matrices" ", this can be a `matrix`, or a `data.frame`. However, this type can also" @@ -146,8 +146,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& /* data */, - const typename boost::disable_if>::type*, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return "An mlpack model pointer. `` refers to the type of model that " "is being stored, so, e.g., for `cf()`, the type will be `CFModel`. " From fe7bfbbb789b9fe14be35822ea674fe875eb0c2c Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sun, 27 Jun 2021 16:57:27 +0200 Subject: [PATCH 08/19] Python Binding now... Signed-off-by: Omar Shrit --- src/mlpack/bindings/python/default_param.hpp | 24 +++--- .../bindings/python/default_param_impl.hpp | 22 ++--- .../bindings/python/get_cython_type.hpp | 44 +++++----- .../bindings/python/get_printable_param.hpp | 22 ++--- .../bindings/python/get_printable_type.hpp | 84 +++++++++---------- .../python/get_printable_type_impl.hpp | 84 +++++++++---------- src/mlpack/bindings/python/import_decl.hpp | 10 +-- .../bindings/python/print_class_defn.hpp | 10 +-- .../python/print_input_processing.hpp | 36 ++++---- .../python/print_output_processing.hpp | 18 ++-- src/mlpack/bindings/python/print_type_doc.hpp | 14 ++-- .../bindings/python/print_type_doc_impl.hpp | 14 ++-- 12 files changed, 191 insertions(+), 191 deletions(-) diff --git a/src/mlpack/bindings/python/default_param.hpp b/src/mlpack/bindings/python/default_param.hpp index 15504a74b4..36a6b19c32 100644 --- a/src/mlpack/bindings/python/default_param.hpp +++ b/src/mlpack/bindings/python/default_param.hpp @@ -26,12 +26,12 @@ namespace python { template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Return the default value of a vector option. @@ -39,7 +39,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Return the default value of a string option. @@ -47,7 +47,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Return the default value of a matrix option, a tuple option, a @@ -57,10 +57,10 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if_c< + const typename std::enable_if< arma::is_arma_type::value || std::is_same>::value>::type* /* junk */ = 0); + arma::mat>>::value>::type* = 0); /** * Return the default value of a model option (this returns the default @@ -69,8 +69,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Return the default value of an option. This is the function that will be diff --git a/src/mlpack/bindings/python/default_param_impl.hpp b/src/mlpack/bindings/python/default_param_impl.hpp index 15c7f344ae..d953c2efb2 100644 --- a/src/mlpack/bindings/python/default_param_impl.hpp +++ b/src/mlpack/bindings/python/default_param_impl.hpp @@ -24,12 +24,12 @@ namespace python { template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type* /* junk */) { std::ostringstream oss; if (std::is_same::value) @@ -46,7 +46,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */) { // Print each element in an array delimited by square brackets. std::ostringstream oss; @@ -89,7 +89,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*) { const std::string& s = *boost::any_cast(&data.value); return "'" + s + "'"; @@ -102,7 +102,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename boost::enable_if_c< + const typename std::enable_if< arma::is_arma_type::value || std::is_same>::value>::type* /* junk */) @@ -134,8 +134,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */) { return "None"; } diff --git a/src/mlpack/bindings/python/get_cython_type.hpp b/src/mlpack/bindings/python/get_cython_type.hpp index bb01da538e..705b785758 100644 --- a/src/mlpack/bindings/python/get_cython_type.hpp +++ b/src/mlpack/bindings/python/get_cython_type.hpp @@ -23,9 +23,9 @@ namespace python { template inline std::string GetCythonType( util::ParamData& /* d */, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { return "unknown"; } @@ -33,9 +33,9 @@ inline std::string GetCythonType( template<> inline std::string GetCythonType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return "int"; } @@ -43,9 +43,9 @@ inline std::string GetCythonType( template<> inline std::string GetCythonType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return "double"; } @@ -53,9 +53,9 @@ inline std::string GetCythonType( template<> inline std::string GetCythonType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return "string"; } @@ -63,9 +63,9 @@ inline std::string GetCythonType( template<> inline std::string GetCythonType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return "size_t"; } @@ -73,9 +73,9 @@ inline std::string GetCythonType( template<> inline std::string GetCythonType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return "cbool"; } @@ -83,7 +83,7 @@ inline std::string GetCythonType( template inline std::string GetCythonType( util::ParamData& d, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { return "vector[" + GetCythonType(d) + "]"; } @@ -91,7 +91,7 @@ inline std::string GetCythonType( template inline std::string GetCythonType( util::ParamData& d, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { std::string type = "Mat"; if (T::is_row) @@ -105,8 +105,8 @@ inline std::string GetCythonType( template inline std::string GetCythonType( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { return d.cppType + "*"; } diff --git a/src/mlpack/bindings/python/get_printable_param.hpp b/src/mlpack/bindings/python/get_printable_param.hpp index effdf4f07b..44ab825687 100644 --- a/src/mlpack/bindings/python/get_printable_param.hpp +++ b/src/mlpack/bindings/python/get_printable_param.hpp @@ -25,11 +25,11 @@ namespace python { template std::string GetPrintableParam( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { std::ostringstream oss; oss << boost::any_cast(data.value); @@ -42,7 +42,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { const T& t = boost::any_cast(data.value); @@ -58,7 +58,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { // Get the matrix. const T& matrix = boost::any_cast(data.value); @@ -74,8 +74,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { std::ostringstream oss; oss << data.cppType << " model at " << boost::any_cast(data.value); @@ -88,8 +88,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if>::value>::type* = 0) { // Get the matrix. const T& tuple = boost::any_cast(data.value); diff --git a/src/mlpack/bindings/python/get_printable_type.hpp b/src/mlpack/bindings/python/get_printable_type.hpp index 2b7cfb40ed..41593e4681 100644 --- a/src/mlpack/bindings/python/get_printable_type.hpp +++ b/src/mlpack/bindings/python/get_printable_type.hpp @@ -23,84 +23,84 @@ namespace python { template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*); + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*); + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*); + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*); + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*); + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*); template inline std::string GetPrintableType( util::ParamData& d, - const typename boost::enable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::enable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::enable_if>>::type* = 0); + const typename std::enable_if>::value>::type* = 0); template inline std::string GetPrintableType( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); template void GetPrintableType(util::ParamData& d, diff --git a/src/mlpack/bindings/python/get_printable_type_impl.hpp b/src/mlpack/bindings/python/get_printable_type_impl.hpp index 0181079aa1..9494065b4b 100644 --- a/src/mlpack/bindings/python/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/python/get_printable_type_impl.hpp @@ -22,11 +22,11 @@ namespace python { template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "unknown"; } @@ -34,11 +34,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "int"; } @@ -46,11 +46,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "float"; } @@ -58,11 +58,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "str"; } @@ -70,11 +70,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "int"; } @@ -82,11 +82,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "bool"; } @@ -94,9 +94,9 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& d, - const typename boost::enable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "list of " + GetPrintableType(d) + "s"; } @@ -104,9 +104,9 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::enable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { std::string type = "matrix"; if (std::is_same::value) @@ -127,8 +127,8 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::enable_if>>::type*) + const typename std::enable_if>::value>::type*) { return "categorical matrix"; } @@ -136,10 +136,10 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& d, - const typename boost::disable_if>::type*, - const typename boost::enable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return d.cppType + "Type"; } diff --git a/src/mlpack/bindings/python/import_decl.hpp b/src/mlpack/bindings/python/import_decl.hpp index b060a66dfe..e6518ce461 100644 --- a/src/mlpack/bindings/python/import_decl.hpp +++ b/src/mlpack/bindings/python/import_decl.hpp @@ -26,8 +26,8 @@ template void ImportDecl( util::ParamData& d, const size_t indent, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // First, we have to parse the type. If we have something like, e.g., // 'LogisticRegression<>', we must convert this to 'LogisticRegression[T=*].' @@ -53,8 +53,8 @@ template void ImportDecl( util::ParamData& /* d */, const size_t /* indent */, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // Print nothing. } @@ -66,7 +66,7 @@ template void ImportDecl( util::ParamData& /* d */, const size_t /* indent */, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { // Print nothing. } diff --git a/src/mlpack/bindings/python/print_class_defn.hpp b/src/mlpack/bindings/python/print_class_defn.hpp index ff1de4b26e..53d07d11e7 100644 --- a/src/mlpack/bindings/python/print_class_defn.hpp +++ b/src/mlpack/bindings/python/print_class_defn.hpp @@ -25,8 +25,8 @@ namespace python { template void PrintClassDefn( util::ParamData& /* d */, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // Do nothing. } @@ -37,7 +37,7 @@ void PrintClassDefn( template void PrintClassDefn( util::ParamData& /* d */, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { // Do nothing. } @@ -48,8 +48,8 @@ void PrintClassDefn( template void PrintClassDefn( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // First, we have to parse the type. If we have something like, e.g., // 'LogisticRegression<>', we must convert this to 'LogisticRegression[].' diff --git a/src/mlpack/bindings/python/print_input_processing.hpp b/src/mlpack/bindings/python/print_input_processing.hpp index c4a8ed5006..5137db40e9 100644 --- a/src/mlpack/bindings/python/print_input_processing.hpp +++ b/src/mlpack/bindings/python/print_input_processing.hpp @@ -31,11 +31,11 @@ template void PrintInputProcessing( util::ParamData& d, const size_t indent, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { // The copy_all_inputs parameter must be handled first, and therefore is // outside the scope of this code. @@ -164,11 +164,11 @@ template void PrintInputProcessing( util::ParamData& d, const size_t indent, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { const std::string prefix(indent, ' '); @@ -251,8 +251,8 @@ template void PrintInputProcessing( util::ParamData& d, const size_t indent, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { const std::string prefix(indent, ' '); @@ -372,9 +372,9 @@ template void PrintInputProcessing( util::ParamData& d, const size_t indent, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // First, get the correct class name if needed. std::string strippedType, printedType, defaultsType; @@ -445,9 +445,9 @@ template void PrintInputProcessing( util::ParamData& d, const size_t indent, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { // The user should pass in a matrix type of some sort. const std::string prefix(indent, ' '); diff --git a/src/mlpack/bindings/python/print_output_processing.hpp b/src/mlpack/bindings/python/print_output_processing.hpp index af1ef95a93..e9c89200b3 100644 --- a/src/mlpack/bindings/python/print_output_processing.hpp +++ b/src/mlpack/bindings/python/print_output_processing.hpp @@ -30,10 +30,10 @@ void PrintOutputProcessing( util::ParamData& d, const size_t indent, const bool onlyOutput, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { const std::string prefix(indent, ' '); @@ -86,7 +86,7 @@ void PrintOutputProcessing( util::ParamData& d, const size_t indent, const bool onlyOutput, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { const std::string prefix(indent, ' '); @@ -128,8 +128,8 @@ void PrintOutputProcessing( util::ParamData& d, const size_t indent, const bool onlyOutput, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if>::value>::type* = 0) { const std::string prefix(indent, ' '); @@ -170,8 +170,8 @@ void PrintOutputProcessing( util::ParamData& d, const size_t indent, const bool onlyOutput, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // Get the type names we need to use. std::string strippedType, printedType, defaultsType; diff --git a/src/mlpack/bindings/python/print_type_doc.hpp b/src/mlpack/bindings/python/print_type_doc.hpp index 88186faafb..aad90ee4b7 100644 --- a/src/mlpack/bindings/python/print_type_doc.hpp +++ b/src/mlpack/bindings/python/print_type_doc.hpp @@ -25,11 +25,11 @@ namespace python { template std::string PrintTypeDoc( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Return a string representing the command-line type of a vector. @@ -62,8 +62,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Print the command-line type of an option into a string. diff --git a/src/mlpack/bindings/python/print_type_doc_impl.hpp b/src/mlpack/bindings/python/print_type_doc_impl.hpp index 8ab5986721..64b6ca3e22 100644 --- a/src/mlpack/bindings/python/print_type_doc_impl.hpp +++ b/src/mlpack/bindings/python/print_type_doc_impl.hpp @@ -24,11 +24,11 @@ namespace python { template std::string PrintTypeDoc( util::ParamData& data, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { // A flag type. if (std::is_same::value) @@ -150,8 +150,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& /* data */, - const typename boost::disable_if>::type*, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return "An mlpack model pointer. This type can be pickled to or from disk, " "and internally holds a pointer to C++ memory containing the mlpack " From c6e76d5919d84b3dc50ccc68367dd00f6a9eb409 Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sun, 27 Jun 2021 17:20:27 +0200 Subject: [PATCH 09/19] GO also, could not check it locally, hard to install gonum Signed-off-by: Omar Shrit --- src/mlpack/bindings/go/default_param.hpp | 24 +++--- src/mlpack/bindings/go/default_param_impl.hpp | 22 +++--- src/mlpack/bindings/go/get_go_type.hpp | 76 +++++++++---------- .../bindings/go/get_printable_param.hpp | 22 +++--- src/mlpack/bindings/go/get_printable_type.hpp | 74 +++++++++--------- .../bindings/go/get_printable_type_impl.hpp | 74 +++++++++--------- src/mlpack/bindings/go/get_type.hpp | 44 +++++------ src/mlpack/bindings/go/print_defn_input.hpp | 18 ++--- src/mlpack/bindings/go/print_defn_output.hpp | 18 ++--- .../bindings/go/print_input_processing.hpp | 18 ++--- .../bindings/go/print_method_config.hpp | 18 ++--- src/mlpack/bindings/go/print_method_init.hpp | 18 ++--- .../bindings/go/print_output_processing.hpp | 18 ++--- src/mlpack/bindings/go/print_type_doc.hpp | 14 ++-- .../bindings/go/print_type_doc_impl.hpp | 14 ++-- 15 files changed, 236 insertions(+), 236 deletions(-) diff --git a/src/mlpack/bindings/go/default_param.hpp b/src/mlpack/bindings/go/default_param.hpp index 7469b30ac3..4b967b270e 100644 --- a/src/mlpack/bindings/go/default_param.hpp +++ b/src/mlpack/bindings/go/default_param.hpp @@ -26,12 +26,12 @@ namespace go { template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Return the default value of a vector option. @@ -39,7 +39,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Return the default value of a string option. @@ -47,7 +47,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Return the default value of a matrix option, a tuple option, a @@ -57,10 +57,10 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if_c< + const typename std::enable_if< arma::is_arma_type::value || std::is_same>::value>::type* /* junk */ = 0); + arma::mat>>::value>::type* = 0); /** * Return the default value of a model option (this returns the default @@ -69,8 +69,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Return the default value of an option. This is the function that will be diff --git a/src/mlpack/bindings/go/default_param_impl.hpp b/src/mlpack/bindings/go/default_param_impl.hpp index e3a9a07103..4d3c0feca1 100644 --- a/src/mlpack/bindings/go/default_param_impl.hpp +++ b/src/mlpack/bindings/go/default_param_impl.hpp @@ -24,12 +24,12 @@ namespace go { template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type* /* junk */) { std::ostringstream oss; if (std::is_same::value) @@ -46,7 +46,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */) { // Print each element in an array delimited by square brackets. std::ostringstream oss; @@ -90,7 +90,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*) { const std::string& s = *boost::any_cast(&data.value); return "\"" + s + "\""; @@ -102,7 +102,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename boost::enable_if_c< + const typename std::enable_if< arma::is_arma_type::value || std::is_same>::value>::type* /* junk */) @@ -134,8 +134,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */) { return "nil"; } diff --git a/src/mlpack/bindings/go/get_go_type.hpp b/src/mlpack/bindings/go/get_go_type.hpp index 77c851cb99..55bafb2ddb 100644 --- a/src/mlpack/bindings/go/get_go_type.hpp +++ b/src/mlpack/bindings/go/get_go_type.hpp @@ -25,11 +25,11 @@ namespace go { template inline std::string GetGoType( util::ParamData& /* d */, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { return "unknown"; } @@ -37,11 +37,11 @@ inline std::string GetGoType( template<> inline std::string GetGoType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "int"; } @@ -49,11 +49,11 @@ inline std::string GetGoType( template<> inline std::string GetGoType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "float32"; } @@ -61,11 +61,11 @@ inline std::string GetGoType( template<> inline std::string GetGoType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "float64"; } @@ -73,11 +73,11 @@ inline std::string GetGoType( template<> inline std::string GetGoType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "string"; } @@ -85,11 +85,11 @@ inline std::string GetGoType( template<> inline std::string GetGoType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "bool"; } @@ -97,7 +97,7 @@ inline std::string GetGoType( template inline std::string GetGoType( util::ParamData& d, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { return "[]" + GetGoType(d); } @@ -105,9 +105,9 @@ inline std::string GetGoType( template inline std::string GetGoType( util::ParamData& /* d */, - const typename boost::disable_if>>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if>::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { return "mat.Dense"; } @@ -115,8 +115,8 @@ inline std::string GetGoType( template inline std::string GetGoType( util::ParamData& /* d */, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if>::value>::type* = 0) { return "matrixWithInfo"; } @@ -124,8 +124,8 @@ inline std::string GetGoType( template inline std::string GetGoType( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { std::string goStrippedType, strippedType, printedType, defaultsType; StripType(d.cppType, goStrippedType, strippedType, printedType, defaultsType); diff --git a/src/mlpack/bindings/go/get_printable_param.hpp b/src/mlpack/bindings/go/get_printable_param.hpp index 90e5f74590..091bfcba80 100644 --- a/src/mlpack/bindings/go/get_printable_param.hpp +++ b/src/mlpack/bindings/go/get_printable_param.hpp @@ -25,11 +25,11 @@ namespace go { template std::string GetPrintableParam( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { std::ostringstream oss; oss << boost::any_cast(data.value); @@ -42,7 +42,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { const T& t = boost::any_cast(data.value); @@ -58,7 +58,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { // Get the matrix. const T& matrix = boost::any_cast(data.value); @@ -74,8 +74,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { std::ostringstream oss; oss << data.cppType << " model at " << boost::any_cast(data.value); @@ -88,8 +88,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if>::value>::type* = 0) { // Get the matrix. const T& tuple = boost::any_cast(data.value); diff --git a/src/mlpack/bindings/go/get_printable_type.hpp b/src/mlpack/bindings/go/get_printable_type.hpp index 014fcad297..b16533da18 100644 --- a/src/mlpack/bindings/go/get_printable_type.hpp +++ b/src/mlpack/bindings/go/get_printable_type.hpp @@ -23,75 +23,75 @@ namespace go { template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*); + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*); + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*); + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*); + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*); template inline std::string GetPrintableType( util::ParamData& d, - const typename boost::enable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::enable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::enable_if>>::type* = 0); + const typename std::enable_if>::value>::type* = 0); template inline std::string GetPrintableType( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); template void GetPrintableType(util::ParamData& d, diff --git a/src/mlpack/bindings/go/get_printable_type_impl.hpp b/src/mlpack/bindings/go/get_printable_type_impl.hpp index da4df3bec9..921f5f53a1 100644 --- a/src/mlpack/bindings/go/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/go/get_printable_type_impl.hpp @@ -23,11 +23,11 @@ namespace go { template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "unknown"; } @@ -35,11 +35,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "int"; } @@ -47,11 +47,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "float64"; } @@ -59,11 +59,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "string"; } @@ -71,11 +71,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "bool"; } @@ -83,9 +83,9 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& d, - const typename boost::enable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { return "array of " + GetPrintableType(d) + "s"; } @@ -93,9 +93,9 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::enable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { std::string type = "*mat.Dense"; if (T::is_row || T::is_col) @@ -107,8 +107,8 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename boost::enable_if>>::type*) + const typename std::enable_if>::value>::type*) { return "matrixWithInfo"; } @@ -116,10 +116,10 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& d, - const typename boost::disable_if>::type*, - const typename boost::enable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { std::string goStrippedType, strippedType, printedType, defaultsType; StripType(d.cppType, goStrippedType, strippedType, printedType, defaultsType); diff --git a/src/mlpack/bindings/go/get_type.hpp b/src/mlpack/bindings/go/get_type.hpp index c46c87651d..0a1417ccab 100644 --- a/src/mlpack/bindings/go/get_type.hpp +++ b/src/mlpack/bindings/go/get_type.hpp @@ -24,9 +24,9 @@ namespace go { template inline std::string GetType( util::ParamData& /* d */, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { return "unknown"; } @@ -34,9 +34,9 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return "Int"; } @@ -44,9 +44,9 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return "Float"; } @@ -54,9 +54,9 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return "Double"; } @@ -64,9 +64,9 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return "String"; } @@ -74,9 +74,9 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return "Bool"; } @@ -84,7 +84,7 @@ inline std::string GetType( template inline std::string GetType( util::ParamData& d, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { return "Vec" + GetType(d); } @@ -92,7 +92,7 @@ inline std::string GetType( template inline std::string GetType( util::ParamData& /* d */, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { std::string type = ""; if (std::is_same::value) @@ -120,8 +120,8 @@ inline std::string GetType( template inline std::string GetType( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { return d.cppType + "*"; } diff --git a/src/mlpack/bindings/go/print_defn_input.hpp b/src/mlpack/bindings/go/print_defn_input.hpp index 5ae6662a97..c51dfa110b 100644 --- a/src/mlpack/bindings/go/print_defn_input.hpp +++ b/src/mlpack/bindings/go/print_defn_input.hpp @@ -28,10 +28,10 @@ namespace go { template void PrintDefnInput( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { if (d.required) { @@ -46,7 +46,7 @@ void PrintDefnInput( template void PrintDefnInput( util::ParamData& d, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { // param_name *mat.Dense if (d.required) @@ -62,8 +62,8 @@ void PrintDefnInput( template void PrintDefnInput( util::ParamData& d, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if>::value>::type* = 0) { // param_name *DataWithInfo if (d.required) @@ -79,8 +79,8 @@ void PrintDefnInput( template void PrintDefnInput( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // Get the type names we need to use. std::string goStrippedType, strippedType, printedType, defaultsType; diff --git a/src/mlpack/bindings/go/print_defn_output.hpp b/src/mlpack/bindings/go/print_defn_output.hpp index fa70517f10..b18233d1d0 100644 --- a/src/mlpack/bindings/go/print_defn_output.hpp +++ b/src/mlpack/bindings/go/print_defn_output.hpp @@ -27,10 +27,10 @@ namespace go { template void PrintDefnOutput( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { std::cout << GetGoType(d); } @@ -41,7 +41,7 @@ void PrintDefnOutput( template void PrintDefnOutput( util::ParamData& d, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { // *mat.Dense std::cout << "*" << GetGoType(d); @@ -53,8 +53,8 @@ void PrintDefnOutput( template void PrintDefnOutput( util::ParamData& d, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if>::value>::type* = 0) { // *mat.Dense std::cout << "*" << GetGoType(d); @@ -66,8 +66,8 @@ void PrintDefnOutput( template void PrintDefnOutput( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // Get the type names we need to use. std::string goStrippedType, strippedType, printedType, defaultsType; diff --git a/src/mlpack/bindings/go/print_input_processing.hpp b/src/mlpack/bindings/go/print_input_processing.hpp index 99b0f9a9ed..8b6fa77eea 100644 --- a/src/mlpack/bindings/go/print_input_processing.hpp +++ b/src/mlpack/bindings/go/print_input_processing.hpp @@ -29,10 +29,10 @@ template void PrintInputProcessing( util::ParamData& d, const size_t indent, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { const std::string prefix(indent, ' '); @@ -129,7 +129,7 @@ template void PrintInputProcessing( util::ParamData& d, const size_t indent, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { const std::string prefix(indent, ' '); @@ -189,8 +189,8 @@ template void PrintInputProcessing( util::ParamData& d, const size_t indent, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if>::value>::type* = 0) { const std::string prefix(indent, ' '); @@ -250,8 +250,8 @@ template void PrintInputProcessing( util::ParamData& d, const size_t indent, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // First, get the correct classparamName if needed. std::string goStrippedType, strippedType, printedType, defaultsType; diff --git a/src/mlpack/bindings/go/print_method_config.hpp b/src/mlpack/bindings/go/print_method_config.hpp index b4be743d1a..6a51d7205d 100644 --- a/src/mlpack/bindings/go/print_method_config.hpp +++ b/src/mlpack/bindings/go/print_method_config.hpp @@ -29,10 +29,10 @@ template void PrintMethodConfig( util::ParamData& d, const size_t indent, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { const std::string prefix(indent, ' '); @@ -64,7 +64,7 @@ template void PrintMethodConfig( util::ParamData& d, const size_t indent, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { const std::string prefix(indent, ' '); @@ -96,8 +96,8 @@ template void PrintMethodConfig( util::ParamData& d, const size_t indent, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if>::value>::type* = 0) { const std::string prefix(indent, ' '); @@ -129,8 +129,8 @@ template void PrintMethodConfig( util::ParamData& d, const size_t indent, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { const std::string prefix(indent, ' '); diff --git a/src/mlpack/bindings/go/print_method_init.hpp b/src/mlpack/bindings/go/print_method_init.hpp index f1877f48ff..1a9a363c48 100644 --- a/src/mlpack/bindings/go/print_method_init.hpp +++ b/src/mlpack/bindings/go/print_method_init.hpp @@ -29,10 +29,10 @@ template void PrintMethodInit( util::ParamData& d, const size_t indent, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { const std::string prefix(indent, ' '); @@ -86,7 +86,7 @@ template void PrintMethodInit( util::ParamData& d, const size_t indent, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { const std::string prefix(indent, ' '); @@ -118,8 +118,8 @@ template void PrintMethodInit( util::ParamData& d, const size_t indent, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if>::value>::type* = 0) { const std::string prefix(indent, ' '); @@ -151,8 +151,8 @@ template void PrintMethodInit( util::ParamData& d, const size_t indent, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { const std::string prefix(indent, ' '); diff --git a/src/mlpack/bindings/go/print_output_processing.hpp b/src/mlpack/bindings/go/print_output_processing.hpp index 5a5c77fa74..46cec80184 100644 --- a/src/mlpack/bindings/go/print_output_processing.hpp +++ b/src/mlpack/bindings/go/print_output_processing.hpp @@ -29,10 +29,10 @@ template void PrintOutputProcessing( util::ParamData& d, const size_t indent, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { const std::string prefix(indent, ' '); @@ -56,7 +56,7 @@ template void PrintOutputProcessing( util::ParamData& d, const size_t indent, - const typename boost::enable_if>::type* = 0, + const typename std::enable_if::value>::type* = 0, const typename std::enable_if>::value>::type* = 0) { @@ -83,8 +83,8 @@ template void PrintOutputProcessing( util::ParamData& d, const size_t indent, - const typename boost::enable_if>>::type* = 0) + const typename std::enable_if>::value>::type* = 0) { const std::string prefix(indent, ' '); @@ -109,8 +109,8 @@ template void PrintOutputProcessing( util::ParamData& d, const size_t indent, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // Get the type names we need to use. std::string goStrippedType, strippedType, printedType, defaultsType; diff --git a/src/mlpack/bindings/go/print_type_doc.hpp b/src/mlpack/bindings/go/print_type_doc.hpp index 2da51fbb67..b5dde90fa0 100644 --- a/src/mlpack/bindings/go/print_type_doc.hpp +++ b/src/mlpack/bindings/go/print_type_doc.hpp @@ -25,11 +25,11 @@ namespace go { template std::string PrintTypeDoc( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Return a string representing the command-line type of a vector. @@ -62,8 +62,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Print the command-line type of an option into a string. diff --git a/src/mlpack/bindings/go/print_type_doc_impl.hpp b/src/mlpack/bindings/go/print_type_doc_impl.hpp index d0a5fef659..568ef9b059 100644 --- a/src/mlpack/bindings/go/print_type_doc_impl.hpp +++ b/src/mlpack/bindings/go/print_type_doc_impl.hpp @@ -24,11 +24,11 @@ namespace go { template std::string PrintTypeDoc( util::ParamData& data, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>::type*, - const typename boost::disable_if>>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, + const typename std::enable_if>::value>::type*) { // A flag type. if (std::is_same::value) @@ -122,8 +122,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& /* data */, - const typename boost::disable_if>::type*, - const typename boost::enable_if>::type*) + const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*) { return "An mlpack model pointer. This type holds a pointer to C++ memory " "containing the mlpack model. Note that this means the mlpack model " From 3c7d044227c5bf455853c33fd9ecb3bca988206e Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sun, 27 Jun 2021 17:22:17 +0200 Subject: [PATCH 10/19] Fix value::value, even if it has passed the tests Signed-off-by: Omar Shrit --- src/mlpack/bindings/R/print_type_doc.hpp | 6 +++--- src/mlpack/bindings/R/print_type_doc_impl.hpp | 6 +++--- src/mlpack/bindings/cli/set_param.hpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mlpack/bindings/R/print_type_doc.hpp b/src/mlpack/bindings/R/print_type_doc.hpp index 92bbd07dbe..5f0253578b 100644 --- a/src/mlpack/bindings/R/print_type_doc.hpp +++ b/src/mlpack/bindings/R/print_type_doc.hpp @@ -37,7 +37,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value::value>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Return a string representing the command-line type of a matrix option. @@ -45,7 +45,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value::value>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Return a string representing the command-line type of a matrix tuple option. @@ -54,7 +54,7 @@ template std::string PrintTypeDoc( util::ParamData& data, const typename std::enable_if>::value::value>::type* = 0); + std::tuple>::value>::type* = 0); /** * Return a string representing the command-line type of a model. diff --git a/src/mlpack/bindings/R/print_type_doc_impl.hpp b/src/mlpack/bindings/R/print_type_doc_impl.hpp index 79c03bed48..bc8ba85f25 100644 --- a/src/mlpack/bindings/R/print_type_doc_impl.hpp +++ b/src/mlpack/bindings/R/print_type_doc_impl.hpp @@ -64,7 +64,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value::value>::type*) + const typename std::enable_if::value>::type*) { if (std::is_same>::value) { @@ -86,7 +86,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value::value>::type*) + const typename std::enable_if::value>::type*) { if (std::is_same::value) { @@ -129,7 +129,7 @@ template std::string PrintTypeDoc( util::ParamData& /* data */, const typename std::enable_if>::value::value>::type*) + std::tuple>::value>::type*) { return "A 2-d array containing `numeric` data. Like the regular 2-d matrices" ", this can be a `matrix`, or a `data.frame`. However, this type can also" diff --git a/src/mlpack/bindings/cli/set_param.hpp b/src/mlpack/bindings/cli/set_param.hpp index f76f058d2e..8fab3e0fb0 100644 --- a/src/mlpack/bindings/cli/set_param.hpp +++ b/src/mlpack/bindings/cli/set_param.hpp @@ -60,7 +60,7 @@ void SetParam( const boost::any& value, const typename std::enable_if::value || std::is_same>::value::value>::type* = 0) + std::tuple>::value>::type* = 0) { // We're setting the string filename. typedef std::tuple::type> TupleType; From dc28faa8b44397653976e8e384f5bf3d99562040 Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sun, 27 Jun 2021 17:25:23 +0200 Subject: [PATCH 11/19] Finish with tests Signed-off-by: Omar Shrit --- .../tests/delete_allocated_memory.hpp | 10 ++++----- .../bindings/tests/get_allocated_memory.hpp | 10 ++++----- .../bindings/tests/get_printable_param.hpp | 22 +++++++++---------- .../tests/get_printable_param_impl.hpp | 22 +++++++++---------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/mlpack/bindings/tests/delete_allocated_memory.hpp b/src/mlpack/bindings/tests/delete_allocated_memory.hpp index 08f59d74e8..5dd60fa294 100644 --- a/src/mlpack/bindings/tests/delete_allocated_memory.hpp +++ b/src/mlpack/bindings/tests/delete_allocated_memory.hpp @@ -21,8 +21,8 @@ namespace tests { template void DeleteAllocatedMemoryImpl( util::ParamData& /* d */, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // Do nothing. } @@ -30,7 +30,7 @@ void DeleteAllocatedMemoryImpl( template void DeleteAllocatedMemoryImpl( util::ParamData& /* d */, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { // Do nothing. } @@ -38,8 +38,8 @@ void DeleteAllocatedMemoryImpl( template void DeleteAllocatedMemoryImpl( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // Delete the allocated memory (hopefully we actually own it). delete *boost::any_cast(&d.value); diff --git a/src/mlpack/bindings/tests/get_allocated_memory.hpp b/src/mlpack/bindings/tests/get_allocated_memory.hpp index 579dbfdc8e..fb4a903b80 100644 --- a/src/mlpack/bindings/tests/get_allocated_memory.hpp +++ b/src/mlpack/bindings/tests/get_allocated_memory.hpp @@ -22,8 +22,8 @@ namespace tests { template void* GetAllocatedMemory( util::ParamData& /* d */, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { return NULL; } @@ -31,7 +31,7 @@ void* GetAllocatedMemory( template void* GetAllocatedMemory( util::ParamData& /* d */, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0) { return NULL; } @@ -39,8 +39,8 @@ void* GetAllocatedMemory( template void* GetAllocatedMemory( util::ParamData& d, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0) { // Here we have a model; return its memory location. return *boost::any_cast(&d.value); diff --git a/src/mlpack/bindings/tests/get_printable_param.hpp b/src/mlpack/bindings/tests/get_printable_param.hpp index 556c28bd2f..0bf5e2ff24 100644 --- a/src/mlpack/bindings/tests/get_printable_param.hpp +++ b/src/mlpack/bindings/tests/get_printable_param.hpp @@ -27,11 +27,11 @@ namespace tests { template std::string GetPrintableParam( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0); /** * Print a vector option, with spaces between it. @@ -39,7 +39,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Print a matrix option (this just prints the filename). @@ -47,7 +47,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0); /** * Print a serializable class option (this just prints the filename). @@ -55,8 +55,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::disable_if>::type* = 0, - const typename boost::enable_if>::type* = 0); + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0); /** * Print a mapped matrix option (this just prints the filename). @@ -64,8 +64,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>>::type* = 0); + const typename std::enable_if>::value>::type* = 0); /** * Print an option into a std::string. This should print a short, one-line diff --git a/src/mlpack/bindings/tests/get_printable_param_impl.hpp b/src/mlpack/bindings/tests/get_printable_param_impl.hpp index c14d8a4bed..3a6c604b69 100644 --- a/src/mlpack/bindings/tests/get_printable_param_impl.hpp +++ b/src/mlpack/bindings/tests/get_printable_param_impl.hpp @@ -22,11 +22,11 @@ namespace tests { template std::string GetPrintableParam( util::ParamData& data, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>::type* /* junk */, - const typename boost::disable_if>>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if>::value>::type* /* junk */) { std::ostringstream oss; oss << boost::any_cast(data.value); @@ -37,7 +37,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */) { const T& t = boost::any_cast(data.value); @@ -51,7 +51,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& /* data */, - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */) { return "matrix type"; } @@ -60,8 +60,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename boost::disable_if>::type* /* junk */, - const typename boost::enable_if>::type* /* junk */) + const typename std::enable_if::value>::type* /* junk */, + const typename std::enable_if::value>::type* /* junk */) { // Extract the string from the tuple that's being held. std::ostringstream oss; @@ -73,8 +73,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& /* data */, - const typename boost::enable_if>>::type* /* junk */) + const typename std::enable_if>::value>::type* /* junk */) { return "matrix/DatatsetInfo tuple"; } From 2e0b7980e5acc94f3fb8da3715e5c9b573dedf5a Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sun, 27 Jun 2021 17:31:25 +0200 Subject: [PATCH 12/19] Forgetten one.. Signed-off-by: Omar Shrit --- src/mlpack/bindings/cli/in_place_copy.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mlpack/bindings/cli/in_place_copy.hpp b/src/mlpack/bindings/cli/in_place_copy.hpp index d3ed1c9521..f266267bb6 100644 --- a/src/mlpack/bindings/cli/in_place_copy.hpp +++ b/src/mlpack/bindings/cli/in_place_copy.hpp @@ -31,10 +31,10 @@ template void InPlaceCopyInternal( util::ParamData& /* d */, util::ParamData& /* input */, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>::type* = 0, - const typename boost::disable_if>>::type* = 0) + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, + const typename std::enable_if>::value>::type* = 0) { // Nothing to do. } From 68bb344cc13be667f4813efe0a1ecafb2d6ad298 Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Thu, 1 Jul 2021 23:32:42 +0200 Subject: [PATCH 13/19] Fix some of them manually, but great solution Signed-off-by: Omar Shrit --- src/mlpack/bindings/R/get_printable_type.hpp | 12 ++++++++---- src/mlpack/bindings/R/get_printable_type_impl.hpp | 14 +++++++++----- src/mlpack/bindings/R/get_r_type.hpp | 12 ++++++++---- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/mlpack/bindings/R/get_printable_type.hpp b/src/mlpack/bindings/R/get_printable_type.hpp index 4b19c21cdf..6ca4932fe1 100644 --- a/src/mlpack/bindings/R/get_printable_type.hpp +++ b/src/mlpack/bindings/R/get_printable_type.hpp @@ -50,10 +50,14 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !data::HasSerialize::value>::type*, + const typename std::enable_if< + !arma::is_arma_type::value>::type*, + const typename std::enable_if< + !std::is_same>::value>::type*); template<> diff --git a/src/mlpack/bindings/R/get_printable_type_impl.hpp b/src/mlpack/bindings/R/get_printable_type_impl.hpp index a163a615f5..88aa270199 100644 --- a/src/mlpack/bindings/R/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/R/get_printable_type_impl.hpp @@ -58,11 +58,15 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const typename std::enable_if< + !util::IsStdVector::value>::type*, + const typename std::enable_if< + !data::HasSerialize::value>::type*, + const typename std::enable_if< + !arma::is_arma_type::value>::type*, + const typename std::enable_if< + !std::is_same>::value>::type*) { return "character"; } diff --git a/src/mlpack/bindings/R/get_r_type.hpp b/src/mlpack/bindings/R/get_r_type.hpp index d01559ea66..3e92bb717d 100644 --- a/src/mlpack/bindings/R/get_r_type.hpp +++ b/src/mlpack/bindings/R/get_r_type.hpp @@ -83,10 +83,14 @@ inline std::string GetRType( template<> inline std::string GetRType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !data::HasSerialize::value>::type*, + const typename std::enable_if< + !arma::is_arma_type::value>::type*, + const typename std::enable_if< + !std::is_same>::value>::type*) { return "character"; From 3f0a40fa107780dda5b4a68ce8f5e9f320677cda Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Thu, 1 Jul 2021 23:47:50 +0200 Subject: [PATCH 14/19] Do the first line with regexp Signed-off-by: Omar Shrit --- src/mlpack/bindings/R/get_type.hpp | 3 ++- src/mlpack/bindings/go/get_go_type.hpp | 3 ++- src/mlpack/bindings/go/get_printable_type.hpp | 3 ++- src/mlpack/bindings/go/get_printable_type_impl.hpp | 3 ++- src/mlpack/bindings/go/get_type.hpp | 3 ++- src/mlpack/bindings/python/get_cython_type.hpp | 3 ++- src/mlpack/bindings/python/get_printable_type.hpp | 3 ++- src/mlpack/bindings/python/get_printable_type_impl.hpp | 3 ++- 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/mlpack/bindings/R/get_type.hpp b/src/mlpack/bindings/R/get_type.hpp index 574ec6674c..81d57b99c5 100644 --- a/src/mlpack/bindings/R/get_type.hpp +++ b/src/mlpack/bindings/R/get_type.hpp @@ -72,7 +72,8 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !util::isStdVector::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if( template<> inline std::string GetGoType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !util::isStdVector::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !util::isStdVector::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !util::isStdVector::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if( template<> inline std::string GetType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !util::isStdVector::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if::value>::type*) { diff --git a/src/mlpack/bindings/python/get_cython_type.hpp b/src/mlpack/bindings/python/get_cython_type.hpp index 705b785758..ab3d09e633 100644 --- a/src/mlpack/bindings/python/get_cython_type.hpp +++ b/src/mlpack/bindings/python/get_cython_type.hpp @@ -53,7 +53,8 @@ inline std::string GetCythonType( template<> inline std::string GetCythonType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !util::isStdVector::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if::value>::type*) { diff --git a/src/mlpack/bindings/python/get_printable_type.hpp b/src/mlpack/bindings/python/get_printable_type.hpp index 41593e4681..f904fd09c6 100644 --- a/src/mlpack/bindings/python/get_printable_type.hpp +++ b/src/mlpack/bindings/python/get_printable_type.hpp @@ -50,7 +50,8 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !util::isStdVector::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !util::isStdVector::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if Date: Fri, 2 Jul 2021 16:58:01 +0200 Subject: [PATCH 15/19] Fix std::is_same style issue Signed-off-by: Omar Shrit --- src/mlpack/bindings/R/default_param.hpp | 3 ++- src/mlpack/bindings/R/default_param_impl.hpp | 3 ++- src/mlpack/bindings/cli/default_param.hpp | 3 ++- src/mlpack/bindings/cli/default_param_impl.hpp | 3 ++- src/mlpack/bindings/go/default_param.hpp | 3 ++- src/mlpack/bindings/go/default_param_impl.hpp | 3 ++- src/mlpack/bindings/julia/default_param.hpp | 3 ++- src/mlpack/bindings/julia/default_param_impl.hpp | 3 ++- src/mlpack/bindings/python/default_param.hpp | 3 ++- src/mlpack/bindings/python/default_param_impl.hpp | 3 ++- 10 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/mlpack/bindings/R/default_param.hpp b/src/mlpack/bindings/R/default_param.hpp index 8fdf41dfbf..651d976b9b 100644 --- a/src/mlpack/bindings/R/default_param.hpp +++ b/src/mlpack/bindings/R/default_param.hpp @@ -29,7 +29,8 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, const typename std::enable_if>::value>::type* = 0); diff --git a/src/mlpack/bindings/R/default_param_impl.hpp b/src/mlpack/bindings/R/default_param_impl.hpp index 751834baca..8cf4110696 100644 --- a/src/mlpack/bindings/R/default_param_impl.hpp +++ b/src/mlpack/bindings/R/default_param_impl.hpp @@ -27,7 +27,8 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type* /* junk */, - const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, const typename std::enable_if>::value>::type* /* junk */) { diff --git a/src/mlpack/bindings/cli/default_param.hpp b/src/mlpack/bindings/cli/default_param.hpp index 093a03c567..9b5edc9229 100644 --- a/src/mlpack/bindings/cli/default_param.hpp +++ b/src/mlpack/bindings/cli/default_param.hpp @@ -29,7 +29,8 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, const typename std::enable_if>::value>::type* = 0); diff --git a/src/mlpack/bindings/cli/default_param_impl.hpp b/src/mlpack/bindings/cli/default_param_impl.hpp index b002e94611..33a9524e3f 100644 --- a/src/mlpack/bindings/cli/default_param_impl.hpp +++ b/src/mlpack/bindings/cli/default_param_impl.hpp @@ -27,7 +27,8 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type* /* junk */, - const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, const typename std::enable_if>::value>::type* /* junk */) { diff --git a/src/mlpack/bindings/go/default_param.hpp b/src/mlpack/bindings/go/default_param.hpp index 4b967b270e..e2efe85d0a 100644 --- a/src/mlpack/bindings/go/default_param.hpp +++ b/src/mlpack/bindings/go/default_param.hpp @@ -29,7 +29,8 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, const typename std::enable_if>::value>::type* = 0); diff --git a/src/mlpack/bindings/go/default_param_impl.hpp b/src/mlpack/bindings/go/default_param_impl.hpp index 4d3c0feca1..f33c6cccb3 100644 --- a/src/mlpack/bindings/go/default_param_impl.hpp +++ b/src/mlpack/bindings/go/default_param_impl.hpp @@ -27,7 +27,8 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type* /* junk */, - const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, const typename std::enable_if>::value>::type* /* junk */) { diff --git a/src/mlpack/bindings/julia/default_param.hpp b/src/mlpack/bindings/julia/default_param.hpp index fca7d4a488..db714ccc5d 100644 --- a/src/mlpack/bindings/julia/default_param.hpp +++ b/src/mlpack/bindings/julia/default_param.hpp @@ -29,7 +29,8 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, const typename std::enable_if>::value>::type* = 0); diff --git a/src/mlpack/bindings/julia/default_param_impl.hpp b/src/mlpack/bindings/julia/default_param_impl.hpp index f1a71e7cf2..216758df4f 100644 --- a/src/mlpack/bindings/julia/default_param_impl.hpp +++ b/src/mlpack/bindings/julia/default_param_impl.hpp @@ -27,7 +27,8 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type* /* junk */, - const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, const typename std::enable_if>::value>::type* /* junk */) { diff --git a/src/mlpack/bindings/python/default_param.hpp b/src/mlpack/bindings/python/default_param.hpp index 36a6b19c32..cde42983bb 100644 --- a/src/mlpack/bindings/python/default_param.hpp +++ b/src/mlpack/bindings/python/default_param.hpp @@ -29,7 +29,8 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, + const typename std::enable_if::value>::type* = 0, const typename std::enable_if>::value>::type* = 0); diff --git a/src/mlpack/bindings/python/default_param_impl.hpp b/src/mlpack/bindings/python/default_param_impl.hpp index d953c2efb2..0fe60d8ee0 100644 --- a/src/mlpack/bindings/python/default_param_impl.hpp +++ b/src/mlpack/bindings/python/default_param_impl.hpp @@ -27,7 +27,8 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type* /* junk */, - const typename std::enable_if::value>::type*, + const typename std::enable_if::value>::type*, const typename std::enable_if>::value>::type* /* junk */) { From 1beac191adbe216a151ef983c9a7d35a71bc15e7 Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Fri, 2 Jul 2021 17:11:37 +0200 Subject: [PATCH 16/19] Break line on HasSerialize Signed-off-by: Omar Shrit --- src/mlpack/bindings/R/get_type.hpp | 3 ++- src/mlpack/bindings/go/get_go_type.hpp | 3 ++- src/mlpack/bindings/go/get_printable_type.hpp | 3 ++- src/mlpack/bindings/go/get_printable_type_impl.hpp | 3 ++- src/mlpack/bindings/go/get_type.hpp | 3 ++- src/mlpack/bindings/python/get_cython_type.hpp | 3 ++- src/mlpack/bindings/python/get_printable_type.hpp | 3 ++- src/mlpack/bindings/python/get_printable_type_impl.hpp | 3 ++- 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/mlpack/bindings/R/get_type.hpp b/src/mlpack/bindings/R/get_type.hpp index 81d57b99c5..a39ffc46cb 100644 --- a/src/mlpack/bindings/R/get_type.hpp +++ b/src/mlpack/bindings/R/get_type.hpp @@ -74,7 +74,8 @@ inline std::string GetType( util::ParamData& /* d */, const typename std::enable_if< !util::isStdVector::value>::type*, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !data::HasSerialize::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if>::value>::type*) diff --git a/src/mlpack/bindings/go/get_go_type.hpp b/src/mlpack/bindings/go/get_go_type.hpp index 9dbaf67bb7..9fac01f417 100644 --- a/src/mlpack/bindings/go/get_go_type.hpp +++ b/src/mlpack/bindings/go/get_go_type.hpp @@ -75,7 +75,8 @@ inline std::string GetGoType( util::ParamData& /* d */, const typename std::enable_if< !util::isStdVector::value>::type*, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !data::HasSerialize::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if>::value>::type*) diff --git a/src/mlpack/bindings/go/get_printable_type.hpp b/src/mlpack/bindings/go/get_printable_type.hpp index 4d4bb18ff7..4ec81417ce 100644 --- a/src/mlpack/bindings/go/get_printable_type.hpp +++ b/src/mlpack/bindings/go/get_printable_type.hpp @@ -52,7 +52,8 @@ inline std::string GetPrintableType( util::ParamData& /* d */, const typename std::enable_if< !util::isStdVector::value>::type*, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !data::HasSerialize::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if>::value>::type*); diff --git a/src/mlpack/bindings/go/get_printable_type_impl.hpp b/src/mlpack/bindings/go/get_printable_type_impl.hpp index 229c14cf8b..33e85f7c06 100644 --- a/src/mlpack/bindings/go/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/go/get_printable_type_impl.hpp @@ -61,7 +61,8 @@ inline std::string GetPrintableType( util::ParamData& /* d */, const typename std::enable_if< !util::isStdVector::value>::type*, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !data::HasSerialize::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if>::value>::type*) diff --git a/src/mlpack/bindings/go/get_type.hpp b/src/mlpack/bindings/go/get_type.hpp index 1d86f84879..5d7f736301 100644 --- a/src/mlpack/bindings/go/get_type.hpp +++ b/src/mlpack/bindings/go/get_type.hpp @@ -66,7 +66,8 @@ inline std::string GetType( util::ParamData& /* d */, const typename std::enable_if< !util::isStdVector::value>::type*, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !data::HasSerialize::value>::type*, const typename std::enable_if::value>::type*) { return "String"; diff --git a/src/mlpack/bindings/python/get_cython_type.hpp b/src/mlpack/bindings/python/get_cython_type.hpp index ab3d09e633..c9a21f1ed0 100644 --- a/src/mlpack/bindings/python/get_cython_type.hpp +++ b/src/mlpack/bindings/python/get_cython_type.hpp @@ -55,7 +55,8 @@ inline std::string GetCythonType( util::ParamData& /* d */, const typename std::enable_if< !util::isStdVector::value>::type*, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !data::HasSerialize::value>::type*, const typename std::enable_if::value>::type*) { return "string"; diff --git a/src/mlpack/bindings/python/get_printable_type.hpp b/src/mlpack/bindings/python/get_printable_type.hpp index f904fd09c6..eccd123b1a 100644 --- a/src/mlpack/bindings/python/get_printable_type.hpp +++ b/src/mlpack/bindings/python/get_printable_type.hpp @@ -52,7 +52,8 @@ inline std::string GetPrintableType( util::ParamData& /* d */, const typename std::enable_if< !util::isStdVector::value>::type*, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !data::HasSerialize::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if>::value>::type*); diff --git a/src/mlpack/bindings/python/get_printable_type_impl.hpp b/src/mlpack/bindings/python/get_printable_type_impl.hpp index 4f364e2d3c..836aa9fa1d 100644 --- a/src/mlpack/bindings/python/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/python/get_printable_type_impl.hpp @@ -60,7 +60,8 @@ inline std::string GetPrintableType( util::ParamData& /* d */, const typename std::enable_if< !util::isStdVector::value>::type*, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !data::HasSerialize::value>::type*, const typename std::enable_if::value>::type*, const typename std::enable_if>::value>::type*) From 0c7b38f17ebdeb007117db330bdbb094161bdcaf Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Fri, 2 Jul 2021 17:17:05 +0200 Subject: [PATCH 17/19] Fix is_arma_type Signed-off-by: Omar Shrit --- src/mlpack/bindings/R/get_type.hpp | 3 ++- src/mlpack/bindings/go/get_go_type.hpp | 3 ++- src/mlpack/bindings/go/get_printable_type.hpp | 3 ++- src/mlpack/bindings/go/get_printable_type_impl.hpp | 3 ++- src/mlpack/bindings/go/get_type.hpp | 3 ++- src/mlpack/bindings/python/get_cython_type.hpp | 3 ++- src/mlpack/bindings/python/get_printable_type.hpp | 3 ++- src/mlpack/bindings/python/get_printable_type_impl.hpp | 3 ++- 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/mlpack/bindings/R/get_type.hpp b/src/mlpack/bindings/R/get_type.hpp index a39ffc46cb..b9c6e93c80 100644 --- a/src/mlpack/bindings/R/get_type.hpp +++ b/src/mlpack/bindings/R/get_type.hpp @@ -76,7 +76,8 @@ inline std::string GetType( !util::isStdVector::value>::type*, const typename std::enable_if< !data::HasSerialize::value>::type*, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !arma::is_arma_type::value>::type*, const typename std::enable_if>::value>::type*) { diff --git a/src/mlpack/bindings/go/get_go_type.hpp b/src/mlpack/bindings/go/get_go_type.hpp index 9fac01f417..6d00610c47 100644 --- a/src/mlpack/bindings/go/get_go_type.hpp +++ b/src/mlpack/bindings/go/get_go_type.hpp @@ -77,7 +77,8 @@ inline std::string GetGoType( !util::isStdVector::value>::type*, const typename std::enable_if< !data::HasSerialize::value>::type*, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !arma::is_arma_type::value>::type*, const typename std::enable_if>::value>::type*) { diff --git a/src/mlpack/bindings/go/get_printable_type.hpp b/src/mlpack/bindings/go/get_printable_type.hpp index 4ec81417ce..0a9593b8cd 100644 --- a/src/mlpack/bindings/go/get_printable_type.hpp +++ b/src/mlpack/bindings/go/get_printable_type.hpp @@ -54,7 +54,8 @@ inline std::string GetPrintableType( !util::isStdVector::value>::type*, const typename std::enable_if< !data::HasSerialize::value>::type*, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !arma::is_arma_type::value>::type*, const typename std::enable_if>::value>::type*); diff --git a/src/mlpack/bindings/go/get_printable_type_impl.hpp b/src/mlpack/bindings/go/get_printable_type_impl.hpp index 33e85f7c06..3ef255dd8a 100644 --- a/src/mlpack/bindings/go/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/go/get_printable_type_impl.hpp @@ -63,7 +63,8 @@ inline std::string GetPrintableType( !util::isStdVector::value>::type*, const typename std::enable_if< !data::HasSerialize::value>::type*, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !arma::is_arma_type::value>::type*, const typename std::enable_if>::value>::type*) { diff --git a/src/mlpack/bindings/go/get_type.hpp b/src/mlpack/bindings/go/get_type.hpp index 5d7f736301..d6b6d6af88 100644 --- a/src/mlpack/bindings/go/get_type.hpp +++ b/src/mlpack/bindings/go/get_type.hpp @@ -68,7 +68,8 @@ inline std::string GetType( !util::isStdVector::value>::type*, const typename std::enable_if< !data::HasSerialize::value>::type*, - const typename std::enable_if::value>::type*) + const typename std::enable_if< + !arma::is_arma_type::value>::type*) { return "String"; } diff --git a/src/mlpack/bindings/python/get_cython_type.hpp b/src/mlpack/bindings/python/get_cython_type.hpp index c9a21f1ed0..087b97341e 100644 --- a/src/mlpack/bindings/python/get_cython_type.hpp +++ b/src/mlpack/bindings/python/get_cython_type.hpp @@ -57,7 +57,8 @@ inline std::string GetCythonType( !util::isStdVector::value>::type*, const typename std::enable_if< !data::HasSerialize::value>::type*, - const typename std::enable_if::value>::type*) + const typename std::enable_if< + !arma::is_arma_type::value>::type*) { return "string"; } diff --git a/src/mlpack/bindings/python/get_printable_type.hpp b/src/mlpack/bindings/python/get_printable_type.hpp index eccd123b1a..12e8783235 100644 --- a/src/mlpack/bindings/python/get_printable_type.hpp +++ b/src/mlpack/bindings/python/get_printable_type.hpp @@ -54,7 +54,8 @@ inline std::string GetPrintableType( !util::isStdVector::value>::type*, const typename std::enable_if< !data::HasSerialize::value>::type*, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !arma::is_arma_type::value>::type*, const typename std::enable_if>::value>::type*); diff --git a/src/mlpack/bindings/python/get_printable_type_impl.hpp b/src/mlpack/bindings/python/get_printable_type_impl.hpp index 836aa9fa1d..d6517c8139 100644 --- a/src/mlpack/bindings/python/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/python/get_printable_type_impl.hpp @@ -62,7 +62,8 @@ inline std::string GetPrintableType( !util::isStdVector::value>::type*, const typename std::enable_if< !data::HasSerialize::value>::type*, - const typename std::enable_if::value>::type*, + const typename std::enable_if< + !arma::is_arma_type::value>::type*, const typename std::enable_if>::value>::type*) { From a27700b0724b7ff5dc991e878533ee345b4f827a Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Fri, 2 Jul 2021 17:31:05 +0200 Subject: [PATCH 18/19] Fix regexp error Signed-off-by: Omar Shrit --- src/mlpack/bindings/R/default_param.hpp | 2 +- src/mlpack/bindings/R/default_param_impl.hpp | 2 +- src/mlpack/bindings/cli/default_param.hpp | 2 +- src/mlpack/bindings/cli/default_param_impl.hpp | 2 +- src/mlpack/bindings/go/default_param.hpp | 2 +- src/mlpack/bindings/go/default_param_impl.hpp | 2 +- src/mlpack/bindings/julia/default_param.hpp | 2 +- src/mlpack/bindings/julia/default_param_impl.hpp | 2 +- src/mlpack/bindings/python/default_param.hpp | 2 +- src/mlpack/bindings/python/default_param_impl.hpp | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/mlpack/bindings/R/default_param.hpp b/src/mlpack/bindings/R/default_param.hpp index 651d976b9b..2006e2eb23 100644 --- a/src/mlpack/bindings/R/default_param.hpp +++ b/src/mlpack/bindings/R/default_param.hpp @@ -30,7 +30,7 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, + std::string>::value>::type* = 0, const typename std::enable_if>::value>::type* = 0); diff --git a/src/mlpack/bindings/R/default_param_impl.hpp b/src/mlpack/bindings/R/default_param_impl.hpp index 8cf4110696..5447d8738a 100644 --- a/src/mlpack/bindings/R/default_param_impl.hpp +++ b/src/mlpack/bindings/R/default_param_impl.hpp @@ -28,7 +28,7 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type*, + std::string>::value>::type*, const typename std::enable_if>::value>::type* /* junk */) { diff --git a/src/mlpack/bindings/cli/default_param.hpp b/src/mlpack/bindings/cli/default_param.hpp index 9b5edc9229..9be4b4c73d 100644 --- a/src/mlpack/bindings/cli/default_param.hpp +++ b/src/mlpack/bindings/cli/default_param.hpp @@ -30,7 +30,7 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, + std::string>::value>::type* = 0, const typename std::enable_if>::value>::type* = 0); diff --git a/src/mlpack/bindings/cli/default_param_impl.hpp b/src/mlpack/bindings/cli/default_param_impl.hpp index 33a9524e3f..b9defc6374 100644 --- a/src/mlpack/bindings/cli/default_param_impl.hpp +++ b/src/mlpack/bindings/cli/default_param_impl.hpp @@ -28,7 +28,7 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type*, + std::string>::value>::type*, const typename std::enable_if>::value>::type* /* junk */) { diff --git a/src/mlpack/bindings/go/default_param.hpp b/src/mlpack/bindings/go/default_param.hpp index e2efe85d0a..3ebdaae7b3 100644 --- a/src/mlpack/bindings/go/default_param.hpp +++ b/src/mlpack/bindings/go/default_param.hpp @@ -30,7 +30,7 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, + std::string>::value>::type* = 0, const typename std::enable_if>::value>::type* = 0); diff --git a/src/mlpack/bindings/go/default_param_impl.hpp b/src/mlpack/bindings/go/default_param_impl.hpp index f33c6cccb3..2458012966 100644 --- a/src/mlpack/bindings/go/default_param_impl.hpp +++ b/src/mlpack/bindings/go/default_param_impl.hpp @@ -28,7 +28,7 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type*, + std::string>::value>::type*, const typename std::enable_if>::value>::type* /* junk */) { diff --git a/src/mlpack/bindings/julia/default_param.hpp b/src/mlpack/bindings/julia/default_param.hpp index db714ccc5d..0d2b368381 100644 --- a/src/mlpack/bindings/julia/default_param.hpp +++ b/src/mlpack/bindings/julia/default_param.hpp @@ -30,7 +30,7 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, + std::string>::value>::type* = 0, const typename std::enable_if>::value>::type* = 0); diff --git a/src/mlpack/bindings/julia/default_param_impl.hpp b/src/mlpack/bindings/julia/default_param_impl.hpp index 216758df4f..667ecae5f4 100644 --- a/src/mlpack/bindings/julia/default_param_impl.hpp +++ b/src/mlpack/bindings/julia/default_param_impl.hpp @@ -28,7 +28,7 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type*, + std::string>::value>::type*, const typename std::enable_if>::value>::type* /* junk */) { diff --git a/src/mlpack/bindings/python/default_param.hpp b/src/mlpack/bindings/python/default_param.hpp index cde42983bb..5f8bc32ea4 100644 --- a/src/mlpack/bindings/python/default_param.hpp +++ b/src/mlpack/bindings/python/default_param.hpp @@ -30,7 +30,7 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, const typename std::enable_if::value>::type* = 0, + std::string>::value>::type* = 0, const typename std::enable_if>::value>::type* = 0); diff --git a/src/mlpack/bindings/python/default_param_impl.hpp b/src/mlpack/bindings/python/default_param_impl.hpp index 0fe60d8ee0..543253c18b 100644 --- a/src/mlpack/bindings/python/default_param_impl.hpp +++ b/src/mlpack/bindings/python/default_param_impl.hpp @@ -28,7 +28,7 @@ std::string DefaultParamImpl( const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type* /* junk */, const typename std::enable_if::value>::type*, + std::string>::value>::type*, const typename std::enable_if>::value>::type* /* junk */) { From bbb8b4b640aaa7ed37f3afd1e7e3981edf111d32 Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Fri, 2 Jul 2021 17:42:34 +0200 Subject: [PATCH 19/19] Fix IsStdVector Signed-off-by: Omar Shrit --- src/mlpack/bindings/R/get_type.hpp | 2 +- src/mlpack/bindings/go/get_go_type.hpp | 2 +- src/mlpack/bindings/go/get_printable_type.hpp | 2 +- src/mlpack/bindings/go/get_printable_type_impl.hpp | 2 +- src/mlpack/bindings/go/get_type.hpp | 2 +- src/mlpack/bindings/python/get_cython_type.hpp | 2 +- src/mlpack/bindings/python/get_printable_type.hpp | 2 +- src/mlpack/bindings/python/get_printable_type_impl.hpp | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mlpack/bindings/R/get_type.hpp b/src/mlpack/bindings/R/get_type.hpp index b9c6e93c80..55264eedb5 100644 --- a/src/mlpack/bindings/R/get_type.hpp +++ b/src/mlpack/bindings/R/get_type.hpp @@ -73,7 +73,7 @@ template<> inline std::string GetType( util::ParamData& /* d */, const typename std::enable_if< - !util::isStdVector::value>::type*, + !util::IsStdVector::value>::type*, const typename std::enable_if< !data::HasSerialize::value>::type*, const typename std::enable_if< diff --git a/src/mlpack/bindings/go/get_go_type.hpp b/src/mlpack/bindings/go/get_go_type.hpp index 6d00610c47..4fc800ecbf 100644 --- a/src/mlpack/bindings/go/get_go_type.hpp +++ b/src/mlpack/bindings/go/get_go_type.hpp @@ -74,7 +74,7 @@ template<> inline std::string GetGoType( util::ParamData& /* d */, const typename std::enable_if< - !util::isStdVector::value>::type*, + !util::IsStdVector::value>::type*, const typename std::enable_if< !data::HasSerialize::value>::type*, const typename std::enable_if< diff --git a/src/mlpack/bindings/go/get_printable_type.hpp b/src/mlpack/bindings/go/get_printable_type.hpp index 0a9593b8cd..5b2cadece3 100644 --- a/src/mlpack/bindings/go/get_printable_type.hpp +++ b/src/mlpack/bindings/go/get_printable_type.hpp @@ -51,7 +51,7 @@ template<> inline std::string GetPrintableType( util::ParamData& /* d */, const typename std::enable_if< - !util::isStdVector::value>::type*, + !util::IsStdVector::value>::type*, const typename std::enable_if< !data::HasSerialize::value>::type*, const typename std::enable_if< diff --git a/src/mlpack/bindings/go/get_printable_type_impl.hpp b/src/mlpack/bindings/go/get_printable_type_impl.hpp index 3ef255dd8a..cdbfe9feb5 100644 --- a/src/mlpack/bindings/go/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/go/get_printable_type_impl.hpp @@ -60,7 +60,7 @@ template<> inline std::string GetPrintableType( util::ParamData& /* d */, const typename std::enable_if< - !util::isStdVector::value>::type*, + !util::IsStdVector::value>::type*, const typename std::enable_if< !data::HasSerialize::value>::type*, const typename std::enable_if< diff --git a/src/mlpack/bindings/go/get_type.hpp b/src/mlpack/bindings/go/get_type.hpp index d6b6d6af88..828085d375 100644 --- a/src/mlpack/bindings/go/get_type.hpp +++ b/src/mlpack/bindings/go/get_type.hpp @@ -65,7 +65,7 @@ template<> inline std::string GetType( util::ParamData& /* d */, const typename std::enable_if< - !util::isStdVector::value>::type*, + !util::IsStdVector::value>::type*, const typename std::enable_if< !data::HasSerialize::value>::type*, const typename std::enable_if< diff --git a/src/mlpack/bindings/python/get_cython_type.hpp b/src/mlpack/bindings/python/get_cython_type.hpp index 087b97341e..9809e1224e 100644 --- a/src/mlpack/bindings/python/get_cython_type.hpp +++ b/src/mlpack/bindings/python/get_cython_type.hpp @@ -54,7 +54,7 @@ template<> inline std::string GetCythonType( util::ParamData& /* d */, const typename std::enable_if< - !util::isStdVector::value>::type*, + !util::IsStdVector::value>::type*, const typename std::enable_if< !data::HasSerialize::value>::type*, const typename std::enable_if< diff --git a/src/mlpack/bindings/python/get_printable_type.hpp b/src/mlpack/bindings/python/get_printable_type.hpp index 12e8783235..1d454b172a 100644 --- a/src/mlpack/bindings/python/get_printable_type.hpp +++ b/src/mlpack/bindings/python/get_printable_type.hpp @@ -51,7 +51,7 @@ template<> inline std::string GetPrintableType( util::ParamData& /* d */, const typename std::enable_if< - !util::isStdVector::value>::type*, + !util::IsStdVector::value>::type*, const typename std::enable_if< !data::HasSerialize::value>::type*, const typename std::enable_if< diff --git a/src/mlpack/bindings/python/get_printable_type_impl.hpp b/src/mlpack/bindings/python/get_printable_type_impl.hpp index d6517c8139..5a903af575 100644 --- a/src/mlpack/bindings/python/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/python/get_printable_type_impl.hpp @@ -59,7 +59,7 @@ template<> inline std::string GetPrintableType( util::ParamData& /* d */, const typename std::enable_if< - !util::isStdVector::value>::type*, + !util::IsStdVector::value>::type*, const typename std::enable_if< !data::HasSerialize::value>::type*, const typename std::enable_if<