小编Nel*_*yan的帖子

How does changing a template argument from a type to a non-type make SFINAE work?

From the cppreference.com article on std::enable_if,

Notes
A common mistake is to declare two function templates that differ only in their default template arguments. This is illegal because default template arguments are not part of function template's signature, and declaring two different function templates with the same signature is illegal.

/*** WRONG ***/

struct T {
    enum { int_t,float_t } m_type;
    template <
        typename Integer,
        typename = std::enable_if_t<std::is_integral<Integer>::value>
    >
    T(Integer) : m_type(int_t) {}

    template <
        typename Floating,
        typename = …
Run Code Online (Sandbox Code Playgroud)

c++ templates sfinae language-lawyer template-meta-programming

7
推荐指数
3
解决办法
460
查看次数

/ proc/PID文件的格式

我想从/proc目录中检索一些进程信息,我的问题如下:是否有一个标准的文件格式/proc/PID
例如,第一行中有此proc/PID/status文件Name:'\t'ProcName.我可以在其他地方使用空白而不是\t像这样的文件来满足这个文件吗?

linux process

4
推荐指数
1
解决办法
6043
查看次数