1919#include < cstring>
2020#include < optional>
2121#include < type_traits>
22- #include < boost/assert.hpp>
23-
2422#include < takatori/util/assertion.h>
2523
2624#include < jogasaki/constants.h>
25+ #include < jogasaki/utils/assert.h>
2726
2827namespace jogasaki ::accessor {
2928
@@ -63,7 +62,7 @@ class record_ref {
6362 * @warning this function is meaningful only when the field is nullable.
6463 * For non-nullable field, the return value should not be used and ignored.
6564 */
66- [[nodiscard]] bool is_null (offset_type nullity_offset) const noexcept ;
65+ [[nodiscard]] bool is_null (offset_type nullity_offset) const ;
6766
6867 /* *
6968 * @brief set nullity
@@ -75,7 +74,7 @@ class record_ref {
7574 * set beforehand, and this function sets nullity = true, then the value is ignored and the field
7675 * is handled as null.
7776 */
78- void set_null (offset_type nullity_offset, bool nullity = true ) noexcept ;
77+ void set_null (offset_type nullity_offset, bool nullity = true );
7978
8079 /* *
8180 * @brief field value setter
@@ -87,7 +86,7 @@ class record_ref {
8786 */
8887 template <typename T>
8988 void set_value (offset_type value_offset, T x) {
90- BOOST_ASSERT (value_offset < size_); // NOLINT
89+ assert_with_exception (value_offset < size_, value_offset, size_);
9190 static_assert (std::is_trivially_copy_constructible_v<T>);
9291 std::memcpy ( static_cast <char *>(data_) + value_offset, &x, sizeof (T)); // NOLINT
9392 }
@@ -103,7 +102,7 @@ class record_ref {
103102 */
104103 template <typename T>
105104 [[nodiscard]] T get_value (offset_type value_offset) const {
106- BOOST_ASSERT (value_offset < size_); // NOLINT
105+ assert_with_exception (value_offset < size_, value_offset, size_);
107106 static_assert (std::is_trivially_copy_constructible_v<T>);
108107 T data{};
109108 std::memcpy (&data, static_cast <char *>(data_) + value_offset, sizeof (T)); // NOLINT
@@ -121,7 +120,7 @@ class record_ref {
121120 */
122121 template <typename T>
123122 [[nodiscard]] T const & get_reference (offset_type value_offset) const {
124- BOOST_ASSERT (value_offset < size_); // NOLINT
123+ assert_with_exception (value_offset < size_, value_offset, size_);
125124 static_assert (std::is_trivially_copy_constructible_v<T>);
126125 return *reinterpret_cast <T const *>(static_cast <char *>(data_) + value_offset); // NOLINT
127126 }
@@ -135,8 +134,8 @@ class record_ref {
135134 */
136135 template <typename T>
137136 [[nodiscard]] std::optional<T> get_if (offset_type nullity_offset, offset_type value_offset) const {
138- BOOST_ASSERT (nullity_offset / bits_per_byte < size_); // NOLINT
139- BOOST_ASSERT (value_offset < size_); // NOLINT
137+ assert_with_exception (nullity_offset / bits_per_byte < size_, nullity_offset, size_);
138+ assert_with_exception (value_offset < size_, value_offset, size_);
140139 if (is_null (nullity_offset)) {
141140 return {};
142141 }
0 commit comments