Skip to content

Commit ca6ef19

Browse files
authored
Merge pull request #1135 from cppalliance/1099
Add string constructor to all types
2 parents 35fb20b + e4eaf02 commit ca6ef19

File tree

848 files changed

+10002
-34
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

848 files changed

+10002
-34
lines changed

doc/modules/ROOT/pages/decimal128_t.adoc

Lines changed: 9 additions & 0 deletions

doc/modules/ROOT/pages/decimal32_t.adoc

Lines changed: 9 additions & 0 deletions

doc/modules/ROOT/pages/decimal64_t.adoc

Lines changed: 9 additions & 0 deletions

doc/modules/ROOT/pages/decimal_fast128_t.adoc

Lines changed: 9 additions & 0 deletions

doc/modules/ROOT/pages/decimal_fast32_t.adoc

Lines changed: 9 additions & 0 deletions

doc/modules/ROOT/pages/decimal_fast64_t.adoc

Lines changed: 9 additions & 0 deletions
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright 2024 Matt Borland
2+
// Distributed under the Boost Software License, Version 1.0.
3+
// https://www.boost.org/LICENSE_1_0.txt
4+
5+
#include <boost/decimal.hpp>
6+
#include <iostream>
7+
#include <exception>
8+
#include <string>
9+
10+
extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t* data, std::size_t size)
11+
{
12+
try
13+
{
14+
auto c_data = reinterpret_cast<const char*>(data);
15+
const std::string c_data_str {c_data, size}; // Guarantee null termination since we can't pass the size argument
16+
17+
const boost::decimal::decimal32_t d32_val {c_data_str};
18+
const boost::decimal::decimal64_t d64_val {c_data_str};
19+
const boost::decimal::decimal128_t d128_val {c_data_str};
20+
21+
const boost::decimal::decimal_fast32_t df32_val {c_data_str};
22+
const boost::decimal::decimal_fast64_t df64_val {c_data_str};
23+
const boost::decimal::decimal_fast128_t df128_val {c_data_str};
24+
25+
static_cast<void>(d32_val);
26+
static_cast<void>(d64_val);
27+
static_cast<void>(d128_val);
28+
29+
static_cast<void>(df32_val);
30+
static_cast<void>(df64_val);
31+
}
32+
catch(...)
33+
{
34+
}
35+
36+
return 0;
37+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
844�
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.72AAAAAAAAAAAAAAAAAAA
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-80927333333333333333333333333333333AAA.AAAAA833333333333333333333332333333333333333333333333333A3330000003339607008678161066A

0 commit comments

Comments
 (0)