mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-15 18:05:38 +02:00
Fixed std::distance compile error with Oracle Solaris Studio 12.1
Building Catch with Oracle Solaris Studio 12.1 generates an error when calling std::distance due to the toolchains non-compliant STL implementation. This implementation returns its result via an output parameter rather than a return value.
This commit is contained in:
@@ -218,7 +218,12 @@ namespace Catch {
|
||||
|
||||
// using messages.end() directly yields compilation error:
|
||||
std::vector<MessageInfo>::const_iterator itEnd = messages.end();
|
||||
# ifdef CATCH_INTERNAL_SUNPRO_CC_NON_COMPLIANT_STL
|
||||
std::size_t N;
|
||||
std::distance( itMessage, itEnd, N );
|
||||
# else
|
||||
const std::size_t N = static_cast<std::size_t>( std::distance( itMessage, itEnd ) );
|
||||
# endif // CATCH_INTERNAL_SUNPRO_CC_NON_COMPLIANT_STL
|
||||
|
||||
{
|
||||
Colour colourGuard( colour );
|
||||
|
Reference in New Issue
Block a user