/usr/include/wibble/fallback.h is in libwibble-dev 1.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | /** -*- C++ -*-
@file wibble/fallback.h
@author Peter Rockai <me@mornfall.net>
*/
#include <wibble/exception.h>
#ifndef WIBBLE_FALLBACK_H
#define WIBBLE_FALLBACK_H
namespace wibble {
struct Error {};
template< typename T >
struct Fallback {
const T *value;
Fallback( const T &v ) : value( &v ) {}
Fallback( Error = Error() ) : value( 0 ) {}
template< typename E > const T &get( const E &e ) {
if ( !value ) throw e;
return *value;
}
const T &get() {
if ( !value ) throw exception::Consistency( "tried to use undefined fallback value" );
return *value;
}
};
}
#endif
|