diff --git a/includes/std/mem.pat b/includes/std/mem.pat index 23ad5ef..00546e4 100644 --- a/includes/std/mem.pat +++ b/includes/std/mem.pat @@ -5,7 +5,27 @@ */ namespace std::mem { - + + namespace impl { + + struct MagicSearchImpl { + if ($ < (std::mem::size() - std::string::length(Magic) - 1)) { + char __potentialMagic__[std::string::length(Magic)] [[hidden, no_unique_address]]; + + if (__potentialMagic__ == Magic) { + T data [[inline]]; + } else { + padding[1]; + continue; + } + } else { + padding[1]; + continue; + } + }; + + } + /** A Handle for a custom Section */ @@ -189,19 +209,7 @@ namespace std::mem { @tparam T The type to place at the address */ struct MagicSearch { - if ($ < (std::mem::size() - std::string::length(Magic) - 1)) { - char __potentialMagic__[std::string::length(Magic)] [[hidden, no_unique_address]]; - - if (__potentialMagic__ == Magic) { - T data [[inline]]; - } else { - padding[1]; - continue; - } - } else { - padding[1]; - continue; - } + std::mem::impl::MagicSearchImpl impl[while(!std::mem::eof())] [[inline]]; }; /**