Opened 11 years ago

Closed 11 years ago

#6040 closed Bugs (fixed)

static_cast_ problem in Phoenix v3

Reported by: Dragomir Ivanov <drago.ivanov@…> Owned by: Thomas Heller
Milestone: To Be Determined Component: phoenix
Version: Boost 1.47.0 Severity: Problem
Keywords: static_cast_, phoenixv3 Cc:

Description

Hi, I have the following snippet, which compiles fine with Phoenix v2, but spits a bunch of compile errors with Phoenix v3. This is GCC 4.6.1, Boost 1.47. Thank you.

#include <boost/spirit/include/phoenix.hpp> #include <boost/phoenix.hpp> #include <vector> #include <algorithm> #include <sstream> int main() {

std::vector<unsigned char> data; using boost::phoenix::arg_names::_1; using boost::phoenix::static_cast_; std::ostringstream oss; oss << std::hex; std::for_each(data.begin(),data.end(), oss << static_cast_<unsigned int>(_1) );

}

Change History (2)

in reply to:  description comment:1 by Dragomir Ivanov <drago.ivanov@…>, 11 years ago

Oh my, the formating is screwed.

#include <boost/spirit/include/phoenix.hpp>
//#include <boost/phoenix.hpp>
#include <vector>
#include <algorithm>
#include <sstream>
  
int main()
{
    std::vector<unsigned char> data;
    using boost::phoenix::arg_names::_1;
    using boost::phoenix::static_cast_;
    std::ostringstream oss;
    oss << std::hex;
    std::for_each(data.begin(),data.end(), oss <<  static_cast_<unsigned int>(_1) );
}

Replying to Dragomir Ivanov <drago.ivanov@…>:

Hi, I have the following snippet, which compiles fine with Phoenix v2, but spits a bunch of compile errors with Phoenix v3. This is GCC 4.6.1, Boost 1.47. Thank you.

#include <boost/spirit/include/phoenix.hpp> #include <boost/phoenix.hpp> #include <vector> #include <algorithm> #include <sstream> int main() {

std::vector<unsigned char> data; using boost::phoenix::arg_names::_1; using boost::phoenix::static_cast_; std::ostringstream oss; oss << std::hex; std::for_each(data.begin(),data.end(), oss << static_cast_<unsigned int>(_1) );

}

comment:2 by Thomas Heller, 11 years ago

Resolution: fixed
Status: newclosed

Fixed with [75069]. Thanks for reporting!

Note: See TracTickets for help on using tickets.