Skip to content

Commit ec67946

Browse files
Copilotvprus
andauthored
Move 'arg' variable to detail namespace (#151)
Closes #150. Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Vladimir Prus <[email protected]>
1 parent 902aaed commit ec67946

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

include/boost/program_options/detail/value_semantic.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ namespace boost { template<class T> class optional; }
1717

1818
namespace boost { namespace program_options {
1919

20-
extern BOOST_PROGRAM_OPTIONS_DECL std::string arg;
20+
namespace detail {
21+
extern BOOST_PROGRAM_OPTIONS_DECL std::string arg;
22+
}
2123

2224
template<class T, class charT>
2325
std::string
2426
typed_value<T, charT>::name() const
2527
{
26-
std::string const& var = (m_value_name.empty() ? arg : m_value_name);
28+
std::string const& var = (m_value_name.empty() ? detail::arg : m_value_name);
2729
if (!m_implicit_value.empty() && !m_implicit_value_as_text.empty()) {
2830
std::string msg = "[=" + var + "(=" + m_implicit_value_as_text + ")]";
2931
if (!m_default_value.empty() && !m_default_value_as_text.empty())

src/value_semantic.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,14 @@ namespace boost { namespace program_options {
8484
}
8585
#endif
8686

87-
BOOST_PROGRAM_OPTIONS_DECL std::string arg("arg");
87+
namespace detail {
88+
BOOST_PROGRAM_OPTIONS_DECL std::string arg("arg");
89+
}
8890

8991
std::string
9092
untyped_value::name() const
9193
{
92-
return arg;
94+
return detail::arg;
9395
}
9496

9597
unsigned

0 commit comments

Comments
 (0)