From 041f44e809f39d0567f6f191284d555cd6d08de2 Mon Sep 17 00:00:00 2001
From: Marcus Müller <mmueller@gnuradio.org>
Date: Tue, 19 Oct 2021 20:44:11 +0200
Subject: Replace boost::any with std::any
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This is a modernization possible through C++17

Fixes #4780

Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
---
 gnuradio-runtime/lib/pmt/qa_pmt_prims.cc | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

(limited to 'gnuradio-runtime/lib/pmt/qa_pmt_prims.cc')

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);
 
-- 
cgit v1.2.3