Re: #define vs. const
Ioannis Vranos <ivr@guesswh.at .grad.com> writes:
[color=blue]
> Nicolas Pavlidis wrote:
>[color=green]
> > You mean the assert - macro defined in cassert, what Chris means is
> > something like boost::STATIC_A SSERT, which makes the ckeck at
> > compiletime.[/color]
>
>
> How could this be possible for non compile-time constants?[/color]
It's thought to be used only for things that are clear at compiletime.
For example if you're writing templates and becaus of the semantics you
have to reduce the possible types which can be passed to this template,
or if ranges were passed to a template via constants and there is a
upper and lower bound for this constants.
Best regrads,
Nicolas
--
| Nicolas Pavlidis | Elvis Presly: |\ |__ |
| Student of SE & KM | "Into the goto" | \|__| |
| pavnic@sbox.tug raz.at | ICQ #320057056 | |
|-------------------University of Technology, Graz----------------|
Ioannis Vranos <ivr@guesswh.at .grad.com> writes:
[color=blue]
> Nicolas Pavlidis wrote:
>[color=green]
> > You mean the assert - macro defined in cassert, what Chris means is
> > something like boost::STATIC_A SSERT, which makes the ckeck at
> > compiletime.[/color]
>
>
> How could this be possible for non compile-time constants?[/color]
It's thought to be used only for things that are clear at compiletime.
For example if you're writing templates and becaus of the semantics you
have to reduce the possible types which can be passed to this template,
or if ranges were passed to a template via constants and there is a
upper and lower bound for this constants.
Best regrads,
Nicolas
--
| Nicolas Pavlidis | Elvis Presly: |\ |__ |
| Student of SE & KM | "Into the goto" | \|__| |
| pavnic@sbox.tug raz.at | ICQ #320057056 | |
|-------------------University of Technology, Graz----------------|
Comment