From: Eddie Hung Date: Fri, 13 Sep 2019 18:13:57 +0000 (-0700) Subject: Use template specialisation X-Git-Tag: working-ls180~1064^2~2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5473e597bf5aa7a5dc7c831be332baeeddae086f;p=yosys.git Use template specialisation --- diff --git a/kernel/sigtools.h b/kernel/sigtools.h index 2f2d3f5c6..8c0434ceb 100644 --- a/kernel/sigtools.h +++ b/kernel/sigtools.h @@ -135,10 +135,10 @@ struct SigPool } }; -template > +template struct SigSet { - static_assert(!std::is_pointer::value || !std::is_same>::value, "Explicit `Compare' class required for SigSet with pointer-type values!"); + static_assert(!std::is_same::value, "Default value for `Compare' class not found for SigSet. Please specify."); struct bitDef_t : public std::pair { bitDef_t() : std::pair(NULL, 0) { } @@ -222,6 +222,13 @@ struct SigSet } }; +template +class SigSet::value>::type> : public SigSet> {}; +template +using sort_by_name_id_guard = typename std::enable_if::value>::type; +template +class SigSet> : public SigSet::type>> {}; + struct SigMap { mfp database;