std::vector<std::string> to_string(const P1 &p1, const Param& ... param) { // Process the first parameter std::vector<std::string> s; s.push_back(to_string_impl(p1)); // Process the rest with recursive call const auto remainder = to_string(param...); s.insert(s.end(), remainder.begin(), remainder.end()); return s; }
void project(IMutableHypergraph<Arc>* hg, ProjectType projection) { switch (projection) { case kProject_Input: hg->projectInput(); return; case kProject_Output: hg->projectOutput(); return; default: SDL_ERROR(Hypergraph.Project, "unknown projection type: " << to_string_impl(projection)); } }
std::string entry::to_string() const { std::string ret; if(type() == dictionary_t) ret.reserve(280); to_string_impl(ret, 0); #ifdef _DEBUG static std::map<data_type, std::map<size_t, unsigned> > g_entry_stat; auto& item = g_entry_stat[type()]; item[ret.size()]++; // ::Sleep(5000); #endif return ret; }
inline std::string to_string_impl(const T& what) { return to_string_impl(&what, uniform_typeid<T>()); }
std::string entry::to_string() const { std::string ret; to_string_impl(ret, 0); return ret; }
std::string to_string(unsigned long long value, bool* ok) { return to_string_impl(value, ok); }
std::string to_string(long value, bool* ok) { return to_string_impl(value, ok); }
std::string to_string() const { return to_string_impl(); }