Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何利用现有运营商<&书信电报;使用Pantheios登录时是否过载?_C++_Pantheios - Fatal编程技术网

C++ 如何利用现有运营商<&书信电报;使用Pantheios登录时是否过载?

C++ 如何利用现有运营商<&书信电报;使用Pantheios登录时是否过载?,c++,pantheios,C++,Pantheios,如果有大量用户定义的类型实现了操作符,则需要为自己的数据类型提供“垫片”。下面是关于如何执行此操作的文档:。例如: namespace stlsoft { inline stlsoft::shim_string<char> c_str_data_a(Point const& point) { stlsoft::shim_string<char> s(101); int cch = ::sprintf(s, "{%d, %d; area=%

如果有大量用户定义的类型实现了
操作符,则需要为自己的数据类型提供“垫片”。下面是关于如何执行此操作的文档:。例如:

namespace stlsoft
{
  inline stlsoft::shim_string<char> c_str_data_a(Point const& point)
  {
    stlsoft::shim_string<char> s(101);

    int cch = ::sprintf(s, "{%d, %d; area=%d}",
                        point.x, point.y, point.x * point.y);

    s.truncate(static_cast<size_t>(cch));

    return s;
  }
  inline size_t c_str_len_a(Point const& point)
  {
    char buff[101];

    return static_cast<size_t>(::sprintf(&buff[0], "{%d, %d; area=%d}",
                               point.x, point.y, point.x * point.y));
  }

} // namespace stlsoft

祝你好运

有一种方法可以重用
操作符,确保它们位于同一名称空间中。这使得ADL可以发挥作用。@Daniel:我没有看到一个后端可以处理std::ostream之类的?谢谢你的回复!但是如果这是唯一的选择,我将使用一个不同的框架,它可以使用OperatorPhaps,您可以定义上面接受您的类型的模板函数。这些功能可以利用您的
操作员为什么不在Pantheios站点上提交功能请求?Pantheios的主要作者是同一个做STLSoft的人,他提出了这个想法。如果有人能很快做到这一点,他就是那个人,我认为他对请求反应相当积极。
pantheios::log_ERROR("Point: ", point);