Boost logo

Boost Users :

From: Richard Hadsell (hadsell_at_[hidden])
Date: 2007-12-10 13:21:05


Robert Dailey wrote:
> Is there a way I can define constant floats within class scope like
> you can with integral values? I was hoping boost could help in this
> area. For example:
>
> struct default_alpha
> {
> static const float value = 1.0f;
> };
>
> The above is not legal, of course. Anyone? Thanks.
In .h header:

struct default_alpha
{
    static const float value;
};

In .cc source file:

const float default_alpha::value = 1.0f;

Is this answer too simple?

-- 
Dick Hadsell			914-259-6320  Fax: 914-259-6499
Reply-to:			hadsell_at_[hidden]
Blue Sky Studios                http://www.blueskystudios.com
44 South Broadway, White Plains, NY 10601


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net