@@ -141,45 +141,6 @@ struct ReadDestUpdate
141
141
Value& m_value;
142
142
};
143
143
144
- template <typename LocalType, typename Input, typename ReadDest>
145
- decltype (auto ) CustomReadField(TypeList<LocalType>,
146
- Priority<1 >,
147
- InvokeContext& invoke_context,
148
- Input&& input,
149
- ReadDest&& read_dest,
150
- typename std::enable_if<std::is_enum<LocalType>::value>::type* enable = 0 )
151
- {
152
- return read_dest.construct (static_cast <LocalType>(input.get ()));
153
- }
154
-
155
- template <typename LocalType, typename Input, typename ReadDest>
156
- decltype (auto ) CustomReadField(TypeList<LocalType>,
157
- Priority<1 >,
158
- InvokeContext& invoke_context,
159
- Input&& input,
160
- ReadDest&& read_dest,
161
- typename std::enable_if<std::is_integral<LocalType>::value>::type* enable = nullptr )
162
- {
163
- auto value = input.get ();
164
- if (value < std::numeric_limits<LocalType>::min () || value > std::numeric_limits<LocalType>::max ()) {
165
- throw std::range_error (" out of bound int received" );
166
- }
167
- return read_dest.construct (static_cast <LocalType>(value));
168
- }
169
-
170
- template <typename LocalType, typename Input, typename ReadDest>
171
- decltype (auto ) CustomReadField(TypeList<LocalType>,
172
- Priority<1 >,
173
- InvokeContext& invoke_context,
174
- Input&& input,
175
- ReadDest&& read_dest,
176
- typename std::enable_if<std::is_floating_point<LocalType>::value>::type* enable = 0 )
177
- {
178
- auto value = input.get ();
179
- static_assert (std::is_same<LocalType, decltype (value)>::value, " floating point type mismatch" );
180
- return read_dest.construct (value);
181
- }
182
-
183
144
template <typename Input, typename ReadDest>
184
145
decltype (auto ) CustomReadField(TypeList<std::string>,
185
146
Priority<1 >,
@@ -516,43 +477,6 @@ ::capnp::Void BuildPrimitive(InvokeContext& invoke_context, Value&&, TypeList<::
516
477
{
517
478
return {};
518
479
}
519
-
520
- template <typename LocalType, typename Value>
521
- LocalType BuildPrimitive (InvokeContext& invoke_context,
522
- const Value& value,
523
- TypeList<LocalType>,
524
- typename std::enable_if<std::is_enum<Value>::value>::type* enable = nullptr )
525
- {
526
- using E = std::make_unsigned_t <std::underlying_type_t <Value>>;
527
- using T = std::make_unsigned_t <LocalType>;
528
- static_assert (std::numeric_limits<T>::max () >= std::numeric_limits<E>::max (), " mismatched integral/enum types" );
529
- return static_cast <LocalType>(value);
530
- }
531
-
532
- template <typename LocalType, typename Value>
533
- LocalType BuildPrimitive (InvokeContext& invoke_context,
534
- const Value& value,
535
- TypeList<LocalType>,
536
- typename std::enable_if<std::is_integral<Value>::value, int >::type* enable = nullptr )
537
- {
538
- static_assert (
539
- std::numeric_limits<LocalType>::lowest () <= std::numeric_limits<Value>::lowest (), " mismatched integral types" );
540
- static_assert (
541
- std::numeric_limits<LocalType>::max () >= std::numeric_limits<Value>::max (), " mismatched integral types" );
542
- return value;
543
- }
544
-
545
- template <typename LocalType, typename Value>
546
- LocalType BuildPrimitive (InvokeContext& invoke_context,
547
- const Value& value,
548
- TypeList<LocalType>,
549
- typename std::enable_if<std::is_floating_point<Value>::value>::type* enable = nullptr )
550
- {
551
- static_assert (std::is_same<Value, LocalType>::value,
552
- " mismatched floating point types. please fix message.capnp type declaration to match wrapped interface" );
553
- return value;
554
- }
555
-
556
480
template <typename Output>
557
481
void CustomBuildField (TypeList<std::exception>,
558
482
Priority<1 >,
0 commit comments