aboutsummaryrefslogtreecommitdiffstats
path: root/consteval_huffman.hpp
diff options
context:
space:
mode:
authorclyne <clyne@bitgloo.com>2020-11-14 21:00:09 -0500
committerGitHub <noreply@github.com>2020-11-14 21:00:09 -0500
commite58cd3813232845ad301753590e3a21eafecf6ce (patch)
tree597cc9b4718eb0553b093ba80a287c34b2ad5421 /consteval_huffman.hpp
parentd2249cbbfac61e4e9a8af28a2e10c65353f7e761 (diff)
fixed bytes_saved for reporting negative values
Diffstat (limited to 'consteval_huffman.hpp')
-rw-r--r--consteval_huffman.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/consteval_huffman.hpp b/consteval_huffman.hpp
index 82a39c0..6061764 100644
--- a/consteval_huffman.hpp
+++ b/consteval_huffman.hpp
@@ -17,10 +17,10 @@
* @tparam data The string of data to be compressed.
* @tparam data_length The size in bytes of the data, defaults to using strlen().
*/
-template<const char *data, std::size_t data_length = std::char_traits<char>::length(data)>
+template<const char *data, auto data_length = std::char_traits<char>::length(data)>
class huffman_compress
{
- using size_t = unsigned long int;
+ using size_t = long int;
// Jump to the bottom of this header for the public-facing features of this
// class.
@@ -274,7 +274,7 @@ public:
consteval static auto uncompressed_size() {
return data_length;
}
- consteval static auto bytes_saved() {
+ consteval static size_t bytes_saved() {
return uncompressed_size() - compressed_size();
}