Subject: [boost] [Boost.Test][Boot.Timer v2] header only boost.test conflicts with Boot.Timer V2
From: Tan, Tom (Shanghai) (TTan_at_[hidden])
Date: 2016-05-29 02:59:55


This following simple snippet would yield an error with visual studio 2015 for both boost1.60.61:

boost/timer/timer.hpp(32): error C2757: 'timer': a symbol with this name already exists and therefore this name cannot be used as a namespace name

// compiled with cl.exe /EHsc
#define BOOST_TEST_MODULE test
#include <boost/test/included/unit_test.hpp>
#include <boost/timer/timer.hpp>

The following variants are ok

// compiled with cl.exe /EHsc
#define BOOST_TEST_MODULE test
#include <boost/test/unit_test.hpp>
#include <boost/timer/timer.hpp>

Or

// compiled with cl.exe /EHsc
#define BOOST_TEST_MODULE test
#include <boost/test/included/unit_test.hpp>
#include <boost/timer.hpp>

It looks like Boost.Test is relying on boost.timer v1, which is deprecated in documentation and conflict with V2.