Boost logo

Boost :

From: Richard Smith (richard_at_[hidden])
Date: 2007-04-03 12:45:47


I've just found what I believe to be a new regression on the
boost RC_1_34_0 branch relative to the 1.33.1 release. The
example below is a simplified extract of some real world
where the behaviour of boost::none silently changes.

  #include <string>
  #include <iostream>

  #include <boost/optional.hpp>
  #include <boost/none.hpp>

  namespace sql {
    void literal( std::ostream& os, int i ) {
      os << i;
    }

    void literal( std::ostream& os,
                  boost::optional<std::string> const& str )
    {
      // escaping removed for clarity
      if (str) os << '"' << str.get() << '"';
      else os << "NULL";
    }
  }

  int main() {
    sql::literal( std::cout, boost::none );
  }

In 1.33.1, this prints out 'NULL' (which is what I would
naively expect); on 1.34, it prints '0'. In both cases
compiles cleanly in gcc 4.1.1.

Sorry if this is a known regression, but having just seen
the email saying RC_1_34_0 is down to zero regressions, I
thought a quick-heads up was in order.

Richard


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