[boost] Re: assert() replacement?
by Greg Colvin other posts by this author
Aug 31 1999 5:30PM messages near this date
[boost] Re: assert() replacement?
|
[boost] Re: assert() replacement?
From: Valentin Bonnard <Bonnard.V@[...]..>
> ...
> /users/bonnard/debug_mode.hpp:
> > extern const bool debug_mode = true
>
> /users/bonnard/debug_mode.cpp:
> > #include debug_mode.hpp
> > const bool debug_mode;
I think that, despite the extern, the declaration in debug_mode.hpp is a
definition, because of the initializer:
3.1 Declarations and definitions [basic.def]
1 A declaration (clause _dcl.dcl_) introduces names into a translation
unit or redeclares names introduced by previous declarations. A dec-
laration specifies the interpretation and attributes of these names.
2 A declaration is a definition unless it declares a function without
specifying the function's body (_dcl.fct.def_), it contains the extern
specifier (_dcl.stc_) or a linkage-specification1) (_dcl.link_) and
neither an initializer nor a function-body, it declares a static data
member in a class declaration (_class.static_), it is a class name
declaration (_class.name_), or it is a typedef declaration (_dcl.type-
def_), a using-declaration (_namespace.udecl_), or a using-directive
(_namespace.udir_).
Thread:
Beman Dawes
Valentin Bonnard
Valentin Bonnard
Valentin Bonnard
Valentin Bonnard
Beman Dawes
Valentin Bonnard
Valentin Bonnard
Greg Colvin
Greg Colvin
Greg Colvin
Greg Colvin
Greg Colvin
Beman Dawes
Valentin Bonnard
Greg Colvin
Andy Glew
Andy Glew
Greg Colvin
Beman Dawes
|