static-assert
Is there a compile-time func/macro to determine if a C++0x struct is POD?
I\'d like to have a C++0x stati开发者_如何转开发c_assert that tests whether a given struct type is POD (to prevent other programmers from inadvertently breaking it with new members). ie,[详细]
2023-03-30 20:24 分类:问答C++11: std::max(a,b) in static_assert()?
I noticed, that in [24.4.7] of the last C++-Std Doc N3291 max ist not constexpr: template<class T> const T& max(const T& a, const T& b);[详细]
2023-03-29 09:02 分类:问答Can static_assert check if a type is a vector?
Can static_assert check if a type is a vector? IE, an int would raise the assertion, whereas a vector<int> would not.[详细]
2023-03-25 21:27 分类:问答static_assert not working in Visual C++ 10
I was under impression Visual C++ 10 had built-in static_assert. However when I compile the following[详细]
2023-03-18 03:53 分类:问答How to static_assert in member templates only when they are actually used?
Consider this simple class: template<class T> class Foo{ public: Foo(T const& val) : _val(val) {}[详细]
2023-03-14 02:56 分类:问答How to test whether expression is a temporary?
With the following开发者_开发百科 macro: #define ASSERT_IF_TEMP(expr) static_assert(?, \"Is temporary!\");[详细]
2023-03-08 04:07 分类:问答In C++0x is there something like static_assert which gives a warning instead of an error?
I would like to do this for usages whi开发者_开发知识库ch may be inefficient but not necessarily incorrect.No.[详细]
2023-03-08 04:04 分类:问答How can I add a static assert to check if a variable is static?
I have a macro which works well o开发者_JS百科nly on static local variables (since it uses inline assembly notation to extract data about the variable). I need a way to enforce that the input to the m[详细]
2023-02-24 01:07 分类:问答adding string literal to static_assert
Is there a way to combine what\'s going to be output by static_assert? What I mean开发者_StackOverflow社区 is this:[详细]
2023-02-22 23:55 分类:问答How to do a static assert that a pointer cast is trivial?
Let\'s say I have these types: struct A { int a; };开发者_如何学运维 struct B { int b; }; struct C : public A, public B {[详细]
2023-02-22 01:03 分类:问答