【发布时间】:2016-03-05 16:47:17
【问题描述】:
我正在开发一个自定义库。到目前为止,我已经将 std::tuple 和 std::tie 包装到我自己的 myOwn::Tuple 和 myOwn::tie 中。它们的功能与 std::tuple 和 std::tie 的功能相同。我想用 std::ignore 做类似的事情。
到目前为止,我已经写了以下内容:
namespace myOwn
{
auto
tilde()
-> decltype(std::ignore)
{
return std::ignore;
}
}
我唯一的问题是我现在必须使用带括号的 myOwn::tilde()。我希望能够将其用作 myOwn::tilde。到目前为止,我在 std::ignore 上读到的只是如何使用它,
这里:Possible implementations of std::ignore
这里:Requirements for std::ignore
在这里:C++: Return type of std::tie with std::ignore
我试过了
typedef std::ignore tilde
但这并不成功。任何帮助,将不胜感激。这个问题可能对任何试图包装对象的人有用。
【问题讨论】:
-
你认为
std::ignore是什么? type 或 object ? -
你为什么要包装标准的东西!?
-
auto tilde = std::ignore;有问题吗?