Boost logo

Boost :

Subject: [boost] inline specifier within in class definition
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2009-05-03 17:04:25


Hi,

Could anyone explain why some static member functions defined within
class definitions are specified with inline keyword?

For instance, in boos/serialization/export.hpp

template <class Archive, class Serializable>
struct export_impl
{
...
    inline static void enable_load(mpl::false_) {}
    inline static void enable_save(mpl::false_) {}
};

AFAIU what the C++ Standard says in chapter "9.3 Member functions",
it should be enough to define a member function in its class
definition, "in which case it is an inline member function".

On the other side, the standard also uses this technique,
for instance in example presented in "18.2.1.5 numeric_limits
specializations". I'm having problem with catching what's the
rationale of using extra inline specifier.

I was trying to find answer in the guidelines, but it seems
it isn't explained.

Best regards,

-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org

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