-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add huffman table constructor from symbol-bitsize range
Add a constructor to huffman::table that takes a range of symbol-bitsize tuples. This commit also moves public tag types into a utility header. Change-Id: Ia125173ce91e2e189c23de0956d9eaa7aa51762c
- Loading branch information
Showing
7 changed files
with
216 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
|
||
#include <cstddef> | ||
|
||
namespace starflate::huffman { | ||
|
||
/// Convenience alias for a C-style array | ||
/// | ||
template <class T, std::size_t N> | ||
using c_array = T[N]; | ||
|
||
/// Disambiguation tag to specify a table is constructed with a code-symbol | ||
/// mapping | ||
/// | ||
struct table_contents_tag | ||
{ | ||
explicit table_contents_tag() = default; | ||
}; | ||
inline constexpr auto table_contents = table_contents_tag{}; | ||
|
||
/// Disambiguation tag to specify a table is constructed with a symbol-bitsize | ||
/// mapping | ||
/// | ||
struct symbol_bitsize_tag | ||
{ | ||
explicit symbol_bitsize_tag() = default; | ||
}; | ||
inline constexpr auto symbol_bitsize = symbol_bitsize_tag{}; | ||
|
||
} // namespace starflate::huffman |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.