Skip to content

Commit d7f895a

Browse files
committed
Make friends with other classes
1 parent eed38f6 commit d7f895a

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

include/boost/decimal/decimal128_t.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ constexpr auto to_chars_fixed_impl(char* first, char* last, const TargetDecimalT
9898
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
9999
constexpr auto to_chars_hex_impl(char* first, char* last, const TargetDecimalType& value) noexcept -> to_chars_result;
100100

101+
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
102+
constexpr auto to_chars_cohort_preserving_scientific(char* first, char* last, const TargetDecimalType& value) noexcept -> to_chars_result;
103+
101104
} //namespace detail
102105

103106
BOOST_DECIMAL_EXPORT class decimal128_t final
@@ -205,6 +208,9 @@ BOOST_DECIMAL_EXPORT class decimal128_t final
205208
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
206209
friend constexpr auto detail::to_chars_hex_impl(char* first, char* last, const TargetDecimalType& value) noexcept -> to_chars_result;
207210

211+
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
212+
friend constexpr auto detail::to_chars_cohort_preserving_scientific(char* first, char* last, const TargetDecimalType& value) noexcept -> to_chars_result;
213+
208214
#if !defined(BOOST_DECIMAL_DISABLE_CLIB)
209215
constexpr decimal128_t(const char* str, std::size_t len);
210216
#endif

include/boost/decimal/decimal64_t.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ constexpr auto to_chars_fixed_impl(char* first, char* last, const TargetDecimalT
101101
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
102102
constexpr auto to_chars_hex_impl(char* first, char* last, const TargetDecimalType& value) noexcept -> to_chars_result;
103103

104+
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
105+
constexpr auto to_chars_cohort_preserving_scientific(char* first, char* last, const TargetDecimalType& value) noexcept -> to_chars_result;
106+
104107
template <bool checked, BOOST_DECIMAL_DECIMAL_FLOATING_TYPE T>
105108
constexpr auto d64_fma_impl(T x, T y, T z) noexcept -> T;
106109

@@ -220,6 +223,9 @@ BOOST_DECIMAL_EXPORT class decimal64_t final
220223
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
221224
friend constexpr auto detail::to_chars_hex_impl(char* first, char* last, const TargetDecimalType& value) noexcept -> to_chars_result;
222225

226+
template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE TargetDecimalType>
227+
friend constexpr auto detail::to_chars_cohort_preserving_scientific(char* first, char* last, const TargetDecimalType& value) noexcept -> to_chars_result;
228+
223229
template <bool checked, BOOST_DECIMAL_DECIMAL_FLOATING_TYPE T>
224230
friend constexpr auto detail::d64_fma_impl(T x, T y, T z) noexcept -> T;
225231

test/test_to_chars_quantum.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ void test_to_chars_scientific()
4343
int main()
4444
{
4545
test_to_chars_scientific<decimal32_t>();
46+
test_to_chars_scientific<decimal64_t>();
47+
test_to_chars_scientific<decimal128_t>();
4648

4749
return boost::report_errors();
4850
}

0 commit comments

Comments
 (0)