Skip to content

Commit d2ea292

Browse files
author
Fytch
committed
change parsing_report API and make the member value private
1 parent 2358292 commit d2ea292

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

include/ProgramOptions.hxx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -447,19 +447,21 @@ namespace po {
447447
};
448448

449449
template<typename T>
450-
struct parsing_report {
450+
class parsing_report {
451+
T m_value; // should be optional
452+
453+
public:
451454
error_code error = error_code::none;
452-
T value; // should be optional
453455

454456
parsing_report() = default;
455457
parsing_report(error_code error)
456458
: error(error) {
457459
}
458460
parsing_report(T const& value)
459-
: value(value) {
461+
: m_value(value) {
460462
}
461463
parsing_report(T&& value)
462-
: value(std::move(value)) {
464+
: m_value(std::move(value)) {
463465
}
464466

465467
bool good() const {
@@ -471,7 +473,7 @@ namespace po {
471473

472474
T const& get() const {
473475
PROGRAMOPTIONS_ASSERT(good(), "parsing_report: cannot access data of an erroneous report");
474-
return value;
476+
return m_value;
475477
}
476478
operator T const&() const {
477479
return get();

0 commit comments

Comments
 (0)