Opened 8 years ago

Closed 6 years ago

#10530 closed Bugs (obsolete)

Attempting to define own lexical cast on solaris has to use deprected method

Reported by: Tom Tanner <ttanner2@…> Owned by: Antony Polukhin
Milestone: To Be Determined Component: lexical_cast
Version: Boost 1.55.0 Severity: Regression
Keywords: Cc:

Description

In version 1.41 of boost, it was possible to do (eg this)

namespace boost {

template <> bool lexical_cast(std::string const &s) { ... };

}

In 1.55 this stopped working on sun workshop compiler (Studio 12, version 5.12) saying 'can't find definition in namespace'.

I've had to revert to the deprecated pass-by-value declaration but I can't find any documentation that indicates that this is necessary or why it might have changed.

Change History (2)

comment:1 by Antony Polukhin, 8 years ago

Hmmm, your code still works on GCC 4.6.4:

#include <iostream>
#include <boost/lexical_cast.hpp>

namespace boost {
    template <> bool lexical_cast(std::string const &s) { return true;  };
}

int main() {
    std::cout << boost::lexical_cast<bool>(std::string("Foo"));
    return 0;
}

This makes me think that the problem is related only to the Sun Studio 5.12 compiler. There are no regression testers that currently run the tests on Sun Studio. Two years ago was the last time I saw someone running regression tests on Sun Studio compiler (the compiler was not good because of big problems with partial specializations).

Unfortunately it is impossible for me to solve your issue while there's no regression tester. If you're willing to become one of the testers, take a look at this page, section "Running Boost's Automated Regression and Reporting". Running those tests on Sun Studio will help the Boost developers to solve many of the issues that you may have all around the Boost libraries.

Or, if you have a working solution for this issue, then you can make a pull request with fix to the official lexical cast repo. Or just attach patch to this ticket.

comment:2 by Antony Polukhin, 6 years ago

Resolution: obsolete
Status: newclosed
Note: See TracTickets for help on using tickets.