Boost logo

Boost :

From: mfdylan (dylan_at_[hidden])
Date: 2002-02-19 17:57:53


--- In boost_at_y..., "danl_miller" <danl_miller_at_b...> wrote:
> as: "The storage classes in C++ are static, auto, register, and
> volatile except that auto is weird in that it also is combinable
with
> other storage classes (i.e. the true storage classes) to have
> non-storage-class behavior."

volatile is not a storage class, it's a cv-qualifier like const.
And in fact in C you could also omit the storage class and specify
just the cv-qualifier:

main()
{
   volatile i = 0;
   const j = 0;
}

If we allowed this for the proposed implicit typing scheme then given:

void foo(std::string s)
{
   const t = s.c_str();
   ...
}

Would the type of t be const char* or const char* const? (I would
have thought the latter).

Also it's not clear whether specifying the storage class after the cv-
qualifier is allowed (Comeau online gives a warning).

extern is the other storage class, which can only be used to
initialise a variable outside of block scope.

Dylan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk