Fix ambiguous shared_ptr reference
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Sat, 27 Dec 2025 16:07:38 +0000 (17:07 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Sat, 27 Dec 2025 16:07:38 +0000 (17:07 +0100)
Replace bare 'shared_ptr' with fully qualified 'boost::shared_ptr' to resolve
ambiguity between std::shared_ptr and boost::shared_ptr in C++17.

src/config/configurationoptions.cpp

index 9e574dd..9a96c72 100644 (file)
@@ -57,7 +57,6 @@ using boost::program_options::option_description;
 using boost::program_options::options_description;
 using boost::program_options::value;
 using boost::program_options::variables_map;
-using boost::shared_ptr;
 using I2n::Logger::GlobalLogger;
 
 //-----------------------------------------------------------------------------
@@ -173,7 +172,7 @@ options_description ConfigurationOptions::get_generic_options() const
         // deletes the boost::program_options::option_description, causing
         // multiple freed when ConfigurationOption try to delete it.
         option_description option = generic_option->get_option_description();
-        shared_ptr< option_description > ptr( new option_description( option ) );
+        boost::shared_ptr< option_description > ptr( new option_description( option ) );
         options.add( ptr );
     }
 
@@ -190,14 +189,14 @@ options_description ConfigurationOptions::get_configuration_options() const
     BOOST_FOREACH( ConfigurationOptionItem configuration_option, ConfigOptions )
     {
         option_description option = configuration_option->get_option_description();
-        shared_ptr< option_description > ptr( new option_description( option ) );
+        boost::shared_ptr< option_description > ptr( new option_description( option ) );
         options.add( ptr );
     }
 
-    BOOST_FOREACH( ConfigurationOptionItem host_option, HostOptions )
+    BOOST_FOREACH( HostConfigurationOptionItem host_option, HostOptions )
     {
         option_description option = host_option->get_option_description();
-        shared_ptr< option_description > ptr( new option_description( option ) );
+        boost::shared_ptr< option_description > ptr( new option_description( option ) );
         options.add( ptr );
     }