Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-01-29 23:25:57


On Tuesday 29 January 2002 11:10 pm, you wrote:
> Cool!
>
> So, as I understand it, is_stateless requires user intervention or compiler
> support, right?
> It seems to me that you'd want is_stateless to be true in the following
> cases:
>
> T is a function pointer
> T is const (? maybe not -- there might be a state* const in it)

A function pointer actually does have state (the address of the function it
is pointing to), so the type_traits "is_stateless" will return false for it.

However, the updated (just checked in...) Boost.Function documentation
defines "stateless" in its own way, where T is stateless if:
  T is a function pointer
  is_stateless<T>::value

I'm currently adding in member function pointer support, although that
increases the size of boost::function objects to 16 bytes on my x86 box,
which I'm not quite thrilled about :(. Hard to say if it's worth it or not...

        Doug


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