相关疑难解决方法(0)

使用 Boost.Preprocessor 减少此代码重复

考虑以下代码:

template<typename T0>
void send( const std::string& func, const T0& t0 )
{
   std::ostringstream s;
   s << func << ": " << t0;
   sendMessage( s.str() );
}

template<typename T0, typename T1>
void send( const std::string& func, const T0& t0, const T1& t1 )
{
   std::ostringstream s;
   s << func << ": " << t0 << "," << t1;
   sendMessage( s.str() );
}

template<typename T0, typename T1, typename T2>
void send( const std::string& func, const T0& t0, const T1& t1, const …
Run Code Online (Sandbox Code Playgroud)

c++ boost boost-preprocessor

3
推荐指数
1
解决办法
3000
查看次数

标签 统计

boost ×1

boost-preprocessor ×1

c++ ×1