Skip to content

Commit ffd32c2

Browse files
refactor: Using class
1 parent ffd1fd2 commit ffd32c2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/primitives/primitive.impl.cppm

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ import mcpplibs.primitives.traits.underlying;
88

99
export namespace mcpplibs::primitives {
1010

11-
template <underlying_type T,
12-
policy::policy_type... Policies>
13-
template <underlying_type T,
14-
policy::policy_type... Policies>
11+
template <underlying_type T, policy::policy_type... Policies> class primitive {
12+
public:
1513
using value_type = T;
1614
using policies = std::tuple<Policies...>;
17-
constexpr explicit primitive(T v) noexcept : value(v) {}
18-
T value;
15+
constexpr explicit primitive(T v) noexcept : value_(v) {}
16+
constexpr value_type &value() noexcept { return value_; }
17+
constexpr value_type const &value() const noexcept { return value_; }
18+
19+
private:
20+
T value_;
1921
};
2022

2123
} // namespace mcpplibs::primitives

0 commit comments

Comments
 (0)