1

I work in a specific enterprise environment and there's no C++11 infrastructure at the moment. Recently I started writing unit-tests and decided to utilize Boost.Test framework since Boost is known for its' portability and enterprise-readiness. While general BOOST_AUTO_TEST_CASE work great, I found out that dataset tests (BOOST_DATA_TEST_CASE) end up including boost/test/data/monomorphic/fwd.hpp that includes <tuple> unconditionally. Does DATA_TEST_CASE indeed require C++11? Is there a way to use BOOST_DATA_TEST_CASE and utilize Boost's built-in tuples and other shipped libs to comply with C++03 standard?

Roman K.
  • 13
  • 2
  • Which version of boost? Have you looked at the release notes? – Matthieu Brucher Jan 15 '19 at 17:05
  • 4
    You should be focussing your efforts on upgrading to C++11 - really, there is no excuse for not doing so. You _will_ have to upgrade at some point, so that point may as well be now - 8 years after the C++11 standard came out. –  Jan 15 '19 at 17:05
  • 1
    @NeilButterworth: I disagree. There's no point in upgrading to C++11. They should skip C++11 and upgrade directly to C++17. – Jerry Coffin Jan 15 '19 at 17:13
  • @Jerry No, let's go the whole hog and go for C++20! But seriously, I've been in these "enterprise" environments. and doing any upgrade is a giant political upheaval, which will be opposed on all sides, so you often have to take what you can get. That's not an excuse for doing nothing, however. –  Jan 15 '19 at 17:19
  • If you can''t upgrade to C++11 or better, Catch2 has a Catch1.x branch which will work on pre C++11 compilers. – Michael Surette Jan 15 '19 at 17:23
  • Boost.Test is compatible with C++03, the data test case feature is not (and wasn't from the first release of that feature). – Raffi May 01 '20 at 18:01

1 Answers1

1

Boost doesn't generally deliberately break c++11 compatibility in existing libraries (though this attitude is changing and you should expect more c++11 requirements in future, see discussions on the boost developer mailing lists).

However new libraries and new features for existing libraries don't adhere to this restriction and generally will require c++11 if that makes the implementation easier/simpler/faster/more reliable etc.

BOOST_DATA_TEST_CASE was only introduced in boost 1.59.0 so is likely to be using c++11.

The general advice is if using an old compiler use an old version of boost. If you want new features upgrade your compiler and use a recent version of boost.

Alan Birtles
  • 32,622
  • 4
  • 31
  • 60