Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
runtime template mode processor
//g++ 5.4.0 #include <iostream> #include <boost/algorithm/string.hpp> #include <boost/program_options.hpp> namespace po = boost::program_options; template<int> class Processor{}; enum Modes { md_tolower = 1, md_toupper = 2, md_capitalize = 4, md_trim_start = 8, md_trim_end = 16, md_normalize_spaces = 32, md_stem = 64, md_sort = 128, }; template<> class Processor<md_tolower>{ public: std::string operator(std::string&& s) const { boost::to_lower(s); return s; } }; template<> class Processor<md_toupper>{ public: std::string operator(std::string&& s) const { boost::to_upper(s); return s; } }; template<> class Processor<md_capitalize>{ public: std::string operator(std::string&& s) const { return s; } }; template<> class Processor<md_trim_start>{ public: std::string operator(std::string&& s) const { return s; // TODO } }; template<> class Processor<md_trim_end>{ public: std::string operator(std::string&& s) const { return s; // TODO } }; template<> class Processor<md_normalize_spaces>{ public: std::string operator(std::string&& s) const { return s; // TODO } }; template<> class Processor<md_stem>{ public: std::string operator(std::string&& s) const { return s; // TODO } }; template<> class Processor<md_sort>{ public: std::string operator(std::string&& s) const { return s; // TODO } }; int main() { int mode = 0; po::options_description config_option_list("config options"); config_option_list.add_options() ("mode", po::value<int>(&mode)->default_value(0), "") ; }
run
|
edit
|
history
|
help
0
CutRod
Test 4(2020)
max subsequence of array
mine
Random Vector Generator
poker.hpp
sheetal
Default_Template
Print All Paths In Matrix
BindWithContainer