#include <cstdint>
constexpr uint32_t ticksPerSecond = 100000 ;
struct timemeasure {
constexpr explicit timemeasure( uint64_t c) : ticks( c) { }
uint64_t ticks;
constexpr timemeasure( ) : ticks( 0 ) { }
} ;
struct time : timemeasure {
static volatile time now;
constexpr time ( ) : timemeasure( ) { }
explicit time ( uint64_t c) : timemeasure( c) { }
// Needed for `x = time::now`
explicit time ( const volatile time & t) : timemeasure( t.ticks ) { }
time & operator= ( volatile time t) { ticks = t.ticks ; return * this ; }
} ;
inline time foo( const time & t) { return time ( t.ticks + 1 ) ; }
I2luY2x1ZGUgPGNzdGRpbnQ+Cgpjb25zdGV4cHIgdWludDMyX3QgdGlja3NQZXJTZWNvbmQgPSAxMDAwMDA7CgpzdHJ1Y3QgdGltZW1lYXN1cmUgewogICAgY29uc3RleHByIGV4cGxpY2l0IHRpbWVtZWFzdXJlKHVpbnQ2NF90IGMpIDogdGlja3MoYykgeyB9CiAgICB1aW50NjRfdCB0aWNrczsKICAgIGNvbnN0ZXhwciB0aW1lbWVhc3VyZSgpIDogdGlja3MoMCkgeyB9Cn07CgpzdHJ1Y3QgdGltZSA6IHRpbWVtZWFzdXJlIHsKICAgIHN0YXRpYyB2b2xhdGlsZSB0aW1lIG5vdzsKCiAgICBjb25zdGV4cHIgdGltZSgpIDogdGltZW1lYXN1cmUoKSB7IH0KICAgIGV4cGxpY2l0IHRpbWUodWludDY0X3QgYykgOiB0aW1lbWVhc3VyZShjKSB7IH0KCiAgICAvLyBOZWVkZWQgZm9yIGB4ID0gdGltZTo6bm93YAogICAgZXhwbGljaXQgdGltZShjb25zdCB2b2xhdGlsZSB0aW1lICZ0KSA6IHRpbWVtZWFzdXJlKHQudGlja3MpIHsgfQogICAgdGltZSYgb3BlcmF0b3I9KHZvbGF0aWxlIHRpbWUgdCkgeyB0aWNrcyA9IHQudGlja3M7IHJldHVybiAqdGhpczsgfQp9OwoKaW5saW5lIHRpbWUgZm9vKGNvbnN0IHRpbWUmIHQpIHsgcmV0dXJuIHRpbWUodC50aWNrcyArIDEpOyB9Cg==
compilation info
prog.cpp: In function ‘time foo(const time&)’:
prog.cpp:22:57: error: no matching function for call to ‘time::time(time)’
prog.cpp:22:57: note: candidate is:
prog.cpp:14:15: note: constexpr time::time()
prog.cpp:14:15: note: candidate expects 0 arguments, 1 provided
stdout