Skip to content

Commit f51af51

Browse files
authored
Merge pull request #41 from biojppm/fix/bloated_binary
remove 1.1MB (85%) of binary size by not including iostream
2 parents caade69 + 663fd91 commit f51af51

12 files changed

+20
-18
lines changed

include/fast_float/decimal_to_binary.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <cstdio>
1111
#include <cstdlib>
1212
#include <cstring>
13-
#include <iostream>
1413

1514
namespace fast_float {
1615

include/fast_float/float_common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,8 @@ constexpr int binary_format<float>::smallest_power_of_ten() {
363363
} // namespace fast_float
364364

365365
// for convenience:
366-
#include <ostream>
367-
inline std::ostream &operator<<(std::ostream &out, const fast_float::decimal &d) {
366+
template<class OStream>
367+
inline OStream& operator<<(OStream &out, const fast_float::decimal &d) {
368368
out << "0.";
369369
for (size_t i = 0; i < d.num_digits; i++) {
370370
out << int32_t(d.digits[i]);

tests/exhaustive32.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
#include "fast_float/fast_float.h"
33

4-
4+
#include <iostream>
55
#include <cassert>
66
#include <cmath>
77

@@ -56,4 +56,4 @@ int main() {
5656
std::cout << std::endl;
5757
std::cout << "all ok" << std::endl;
5858
return EXIT_SUCCESS;
59-
}
59+
}

tests/exhaustive32_64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
#include "fast_float/fast_float.h"
33

4-
4+
#include <iostream>
55
#include <cassert>
66
#include <cmath>
77

@@ -70,4 +70,4 @@ int main() {
7070
std::cout << std::endl;
7171
std::cout << "all ok" << std::endl;
7272
return EXIT_SUCCESS;
73-
}
73+
}

tests/exhaustive32_midpoint.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "fast_float/fast_float.h"
22

3-
3+
#include <iostream>
44
#include <cassert>
55
#include <cmath>
66

@@ -119,4 +119,4 @@ int main() {
119119
std::cout << std::endl;
120120
std::cout << "all ok" << std::endl;
121121
return EXIT_SUCCESS;
122-
}
122+
}

tests/long_exhaustive32.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
#include "fast_float/fast_float.h"
33

4-
4+
#include <iostream>
55
#include <cassert>
66
#include <cmath>
77

@@ -57,4 +57,4 @@ int main() {
5757
std::cout << std::endl;
5858
std::cout << "all ok" << std::endl;
5959
return EXIT_SUCCESS;
60-
}
60+
}

tests/long_exhaustive32_64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "fast_float/fast_float.h"
22

3-
3+
#include <iostream>
44
#include <cassert>
55
#include <cmath>
66

@@ -56,4 +56,4 @@ int main() {
5656
std::cout << std::endl;
5757
std::cout << "all ok" << std::endl;
5858
return EXIT_SUCCESS;
59-
}
59+
}

tests/long_random64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "fast_float/fast_float.h"
22

3-
3+
#include <iostream>
44
#include <cassert>
55
#include <cmath>
66

tests/random64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "fast_float/fast_float.h"
22

3-
3+
#include <iostream>
44
#include <cassert>
55
#include <cmath>
66

tests/random_string.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#include "fast_float/fast_float.h"
2+
3+
#include <iostream>
24
#include <cstdint>
35
#include <random>
46

@@ -212,4 +214,4 @@ int main() {
212214
}
213215
std::cout << "Failure." << std::endl;
214216
return EXIT_FAILURE;
215-
}
217+
}

0 commit comments

Comments
 (0)