[Lldb-commits] [PATCH] D138248: [lldb/Python] Make use of PythonObject and PythonFormat in callbacks (NFC)
Med Ismail Bennani via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Nov 17 23:54:30 PST 2022
mib marked 3 inline comments as done.
mib added inline comments.
================
Comment at: lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h:191-194
+template <> struct PythonFormat<char *> {
+ static constexpr char format = 's';
+ static auto get(char *value) { return value; }
+};
----------------
labath wrote:
> Maybe something like:
> ```
> template<typename T, char F> struct PassthroughFormat {
> static constexpr char format = F;
> static constexpr T get(T t) { return t; }
> };
>
> template<> struct PythonFormat<char *> : PassthroughFormat<char *, 's'>;
> // etc.
> ```
More templates <3 !
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138248/new/
https://reviews.llvm.org/D138248
More information about the lldb-commits
mailing list