Skip to content

Commit 279bcf2

Browse files
author
Fytch
committed
implement transitive const-ness in option::get_vector
1 parent 43277c2 commit 279bcf2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ProgramOptions.hxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,13 +1154,16 @@ namespace po {
11541154
}
11551155
#endif // PROGRAMOPTIONS_DEBUG
11561156

1157-
value_vector_base& get_vector() const {
1157+
value_vector_base const& get_vector() const {
11581158
PROGRAMOPTIONS_ASSERT( available(), "cannot access an option with neither user set value nor fallback" );
11591159
if( m_data != nullptr )
11601160
return *m_data;
11611161
else
11621162
return *m_fallback;
11631163
}
1164+
value_vector_base& get_vector() {
1165+
return const_cast< value_vector_base& >( static_cast< option const& >( *this ).get_vector() );
1166+
}
11641167

11651168
parsing_report< value > make_value() const {
11661169
if( get_type() == void_ )

0 commit comments

Comments
 (0)