logical const is a subset of transitive const

Steven Schveighoffer schveiguy at yahoo.com
Fri Sep 14 06:54:30 PDT 2007


"Steven Schveighoffer" wrote
> And in transitive-const land:
>
> class Aprime
> {
>  int m_mutable;
>
>  class B
>  {
>     int m_normal;
>     int f_const() const
>     {
>        return m_normal + m_mutable;
>     }
>
>     void f_nonconst()
>     {
>        m_mutable++;
>        m_normal++;
>     }
>  }
>
>   int f_mutable() const
>   {
>      return m_mutable += m_normal;
>   }

Oops, this should have been:

int f_mutable() // no const

-Steve 





More information about the Digitalmars-d mailing list