Skip to content

Commit

Permalink
Fix type deductions
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph-Edwards committed Jun 28, 2024
1 parent 910552c commit f4122c8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions include/libsemigroups/to-presentation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ namespace libsemigroups {
// with no template WordOutput,
// always use word_type, and can be
// converted after if desirable
Presentation<WordOutput> to_presentation(FroidurePinBase& fp) {
auto to_presentation(FroidurePinBase& fp)
-> std::enable_if_t<!std::is_same_v<WordOutput, std::string>,
Presentation<WordOutput>> {
Presentation<WordOutput> p;
p.alphabet(fp.number_of_generators());
for (auto it = fp.cbegin_rules(); it != fp.cend_rules(); ++it) {
Expand All @@ -70,7 +72,10 @@ namespace libsemigroups {
return p;
}

static inline Presentation<std::string> to_presentation(FroidurePinBase& fp) {
template <typename WordOutput>
auto to_presentation(FroidurePinBase& fp)
-> std::enable_if_t<std::is_same_v<WordOutput, std::string>,
Presentation<WordOutput>> {
Presentation<std::string> p;
p.alphabet(fp.number_of_generators());
for (auto it = fp.cbegin_rules(); it != fp.cend_rules(); ++it) {
Expand Down

0 comments on commit f4122c8

Please sign in to comment.