language: C++ 4.7.2 (gcc-4.7.2)
date: 368 days 2 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <cassert>
 
/** Determine whether the 'foo' attribute of an object is negative. */
template <class T>
bool foo_negative(T& v)
{
    return v.foo < 0;
}
 
struct X
{
    int foo;
};
 
int main()
{
    X x;
    x.foo = 5;
    assert(!foo_negative(x));
    return 0;
}