sfinae
Concept checking of static member variables compile error on gcc
I\'m trying to apply the technique described in http://www.drdobbs.com/tools/227500449 With the sample code below, I expect the output:[详细]
2023-01-21 12:22 分类:问答use sfinae to test namespace members existence
I was trying to figure out if it is possible to use sfinae to test namespace member existence. Google is rather silent about it. I\'ve tried the following code, but it fails.[详细]
2023-01-13 10:57 分类:问答Explain C++ SFINAE to a non-C++ programmer
What is SFINAE in C++? Can you please explain it in words understandable to a programmer who is not versed in C++? Also, what concept in a language like Python does SFINAE correspond开发者_如何转开发[详细]
2023-01-10 10:19 分类:问答boost::enable_if class template method
I got class with template methods that looks at this: struct undefined {}; template<typename T> struct is_undefined : mpl::false_ {};[详细]
2023-01-01 07:23 分类:问答If the address of a function can not be resolved during deduction, is it SFINAE or a compiler error?
In C++0x SFINAE rules have been simplified such that any invalid expression or type that occurs in the \"immediate context\" of deduction does not result in a compiler error but rather in deduction fa[详细]
2022-12-31 13:56 分类:问答Detect if class has overloaded function fails on Comeau compiler
I\'m trying to use SFINAE to detect if a class has an overloaded member function that takes a certain type.The code I have seems to work correctly in Visual Studio and GCC, but does not compile using[详细]
2022-12-28 22:44 分类:问答Multiple SFINAE rules
After reading the answer to this question, I learned that SFINAE can be used to choose between two functions based on whether the class has a certain member function.It\'s the equivalent of the follow[详细]
2022-12-28 11:56 分类:问答Declare module name of classes for logging
I currently am adding some features to our logging-library. One of these is the possibility to declare a module-name for a class that automatically gets preprended to any log-messages writing from wit[详细]
2022-12-24 19:37 分类:问答Why this works (Templates, SFINAE). C++
referring to yesterday\'s post, this woke me up this morning. Why does this actually work? As long as the function test is concerned, this function has no body so how can it perform anything? I want[详细]
2022-12-23 00:11 分类:问答SFINAE canAdd template problem
I\'m trying tow write a SFINAE template to determine whether two classes can be added together. This is mostly to better understand how SFINAE works, rather than for any particular \"real world\" reas[详细]
2022-12-17 13:17 分类:问答