Boost logo

Boost :

From: Jeff Flinn (TriumphSprint2000_at_[hidden])
Date: 2006-03-10 11:15:28


Any obvious reason that supplying a static const data member to a buffer,
for example:

class Client
{
   static const unsigned int sHandShakeGreeting = 0x01020304;

   ba::stream_socket mSock;

   ...

   void SomeFnc()
   {
      ba::async_write( aSocket
                     , ba::buffer(&sHandShakeGreeting,4)
                     , boost::bind( &Client::OnSent, this, _1, _2 ) );
   }

   ...
};

would behave differently from:

const unsigned int sHandShakeGreeting = 0x01020304;

class Client
{

   ba::stream_socket mSock;

   ...

   void SomeFnc()
   {
      ba::async_write( aSocket
                     , ba::buffer(&sHandShakeGreeting,4)
                     , boost::bind( &Client::OnSent, this, _1, _2 ) );
   }

   ...
};

The above all occur within a .cpp file. In the latter case the dialog
continues as expected, but the former results in the server(I don't have
code for) not receiving a valid value. This is using VC7.1.

Thanks, Jeff


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