Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 4, 2025

The arg variable is an implementation detail used as the default placeholder text for option arguments in help messages. It was incorrectly exposed in the public boost::program_options namespace.

Changes

  • include/boost/program_options/detail/value_semantic.hpp: Moved extern declaration into detail namespace; updated reference in typed_value<T, charT>::name()
  • src/value_semantic.cpp: Moved definition into detail namespace; updated reference in untyped_value::name()

Before:

namespace boost { namespace program_options {
    extern BOOST_PROGRAM_OPTIONS_DECL std::string arg;
    // ...
    std::string const& var = (m_value_name.empty() ? arg : m_value_name);
}}

After:

namespace boost { namespace program_options {
    namespace detail {
        extern BOOST_PROGRAM_OPTIONS_DECL std::string arg;
    }
    // ...
    std::string const& var = (m_value_name.empty() ? detail::arg : m_value_name);
}}
Original prompt

in the detail/value_semantic.hpp, move the 'arg' variable to 'detail' sub-namespace. Adjust value_semantic.cpp to match. In the PR, mention issue #150


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Move 'arg' variable to 'detail' sub-namespace Move 'arg' variable to detail namespace (issue #150) Dec 4, 2025
Copilot AI requested a review from vprus December 4, 2025 10:56
@vprus vprus marked this pull request as ready for review December 4, 2025 11:06
@vprus vprus merged commit ec67946 into develop Dec 4, 2025
50 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants