Skip to contentSkip to conversation

C++ pushback

DISCUSSION Robert Hancock 2 participants 2 messages Apr 27, 2006 4 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 22 lines · Denis Vlasenko

Random example. gcc-3.4.3/include/g++-v3/bitset:

  template<size_t _Nw>
    struct _Base_bitset
    {
      typedef unsigned long _WordT;
      /// 0 is the least significant word.
      _WordT            _M_w[_Nw];

      _Base_bitset() { _M_do_reset(); }
...
      void
      _M_do_set()
      {
        for (size_t __i = 0; __i < _Nw; __i++)
          _M_w[__i] = ~static_cast<_WordT>(0);
      }
      void
      _M_do_reset() { memset(_M_w, 0, _Nw * sizeof(_WordT)); }

...

..

Quoted 1 line

Why _M_do_reset() is not inlined?

It is.. anything declared as part of the declaration is considered inline by default.

Signature · 3 lines
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from [email protected]
Home Page: http://www.roberthancock.com/
#5 lore raw
Quoted 24 lines · Robert Hancock
Quoted 20 lines · Denis Vlasenko

Random example. gcc-3.4.3/include/g++-v3/bitset:

  template<size_t _Nw>
    struct _Base_bitset
    {
      typedef unsigned long _WordT;
      /// 0 is the least significant word.
      _WordT            _M_w[_Nw];

      _Base_bitset() { _M_do_reset(); }
...
      void
      _M_do_set()
      {
        for (size_t __i = 0; __i < _Nw; __i++)
          _M_w[__i] = ~static_cast<_WordT>(0);
      }
      void
      _M_do_reset() { memset(_M_w, 0, _Nw * sizeof(_WordT)); }
Quoted 2 lines

...

Quoted 6 lines

..

Quoted 1 line

Why _M_do_reset() is not inlined?

It is.. anything declared as part of the declaration is considered inline by default.

You're right, I forgot about that