Re: [Boost-bugs] [Boost C++ Libraries] #12876: BOOST_CHECK_EQUAL fail for vector<int> with operator<< for vector<T>

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12876: BOOST_CHECK_EQUAL fail for vector<int> with operator<< for vector<T>
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-03-01 02:44:34


#12876: BOOST_CHECK_EQUAL fail for vector<int> with operator<< for vector<T>
-------------------------------+---------------------
  Reporter: 401819174@… | Owner: rogeeff
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: test
   Version: Boost 1.61.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+---------------------

Comment (by 401819174@…):

 BOOST_AUTO_TEST_CASE(test_print_vector_int)
 {
         const std::vector<int> a{1};

         const std::vector<int> b{2};

         std::cout << a << std::endl; /* work */

         BOOST_CHECK_EQUAL(a, b); /* don't work. */

         /* error: static assertion failed: Type has to implement
 operator<< to be printable */

         /* std::cout << boost::has_left_shift<std::ostream,
 vector<int>>::value << endl;*/

         /* use user define class is ok */

         std::vector<PrintClass> c{PrintClass()};
         std::vector<PrintClass> d{PrintClass()};
         std::cout << c << std::endl; /* work */
         BOOST_CHECK_EQUAL(c, d); /* work */
 }

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12876#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-03-01 02:48:52 UTC