diff options
author | Marcus Müller <mmueller@gnuradio.org> | 2021-10-19 20:44:11 +0200 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-10-28 17:23:25 -0400 |
commit | 041f44e809f39d0567f6f191284d555cd6d08de2 (patch) | |
tree | 053b622cd4f9fef7c7956dd981dd5a7103249b39 /gnuradio-runtime/lib/pmt/qa_pmt_prims.cc | |
parent | 50d00f108c3ad62cd7beed6a4cbfdf4f0321c5aa (diff) |
Replace boost::any with std::any
This is a modernization possible through C++17
Fixes #4780
Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
Diffstat (limited to 'gnuradio-runtime/lib/pmt/qa_pmt_prims.cc')
-rw-r--r-- | gnuradio-runtime/lib/pmt/qa_pmt_prims.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gnuradio-runtime/lib/pmt/qa_pmt_prims.cc b/gnuradio-runtime/lib/pmt/qa_pmt_prims.cc index f74dd2f7f9..7219f6f099 100644 --- a/gnuradio-runtime/lib/pmt/qa_pmt_prims.cc +++ b/gnuradio-runtime/lib/pmt/qa_pmt_prims.cc @@ -12,6 +12,7 @@ #include <pmt/api.h> //reason: suppress warnings #include <boost/format.hpp> #include <boost/test/unit_test.hpp> +#include <any> #include <cstring> #include <sstream> @@ -455,9 +456,9 @@ std::ostream& operator<<(std::ostream& os, const foo obj) BOOST_AUTO_TEST_CASE(test_any) { - boost::any a0; - boost::any a1; - boost::any a2; + std::any a0; + std::any a1; + std::any a2; a0 = std::string("Hello!"); a1 = 42; @@ -468,11 +469,11 @@ BOOST_AUTO_TEST_CASE(test_any) pmt::pmt_t p2 = pmt::make_any(a2); BOOST_CHECK_EQUAL(std::string("Hello!"), - boost::any_cast<std::string>(pmt::any_ref(p0))); + std::any_cast<std::string>(pmt::any_ref(p0))); - BOOST_CHECK_EQUAL(42, boost::any_cast<int>(pmt::any_ref(p1))); + BOOST_CHECK_EQUAL(42, std::any_cast<int>(pmt::any_ref(p1))); - BOOST_CHECK_EQUAL(foo(3.250, 21), boost::any_cast<foo>(pmt::any_ref(p2))); + BOOST_CHECK_EQUAL(foo(3.250, 21), std::any_cast<foo>(pmt::any_ref(p2))); } // ------------------------------------------------------------------------ @@ -491,7 +492,7 @@ BOOST_AUTO_TEST_CASE(test_msg_accepter) { pmt::pmt_t sym = pmt::mp("my-symbol"); - boost::any a0; + std::any a0; a0 = std::string("Hello!"); pmt::pmt_t p0 = pmt::make_any(a0); |