From b5edc8b64f0e2f65f3bf63968acc794c8ce93de1 Mon Sep 17 00:00:00 2001 From: morinmorin Date: Sat, 22 Sep 2018 20:44:29 +0900 Subject: [PATCH] Add test for ADL issues. --- test/Jamfile.v2 | 3 +++ test/adl_test.cpp | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 test/adl_test.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index ac694e1..2a0eea0 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -59,4 +59,7 @@ test-suite iterator [ run next_prior_test.cpp ] [ run advance_test.cpp ] [ run distance_test.cpp ] + [ compile adl_test.cpp ] + + [ run shared_iterator_test.cpp ] ; diff --git a/test/adl_test.cpp b/test/adl_test.cpp new file mode 100644 index 0000000..5d5f699 --- /dev/null +++ b/test/adl_test.cpp @@ -0,0 +1,25 @@ +// Copyright (C) 2017 Michel Morin. +// +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include + +int main() +{ + // Test that boost::advance/distance are not found by ADL. + // (https://github.com/boostorg/iterator/issues/43) + + typedef boost::array boost_type; + std::vector std_boost(2); + std::vector::iterator it = std_boost.begin(); + + advance(it, 2); + (void)distance(it, it); + + return 0; +}