YamlIO custom scalar example fix
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 3 18:25:53 PST 2016
Lgtm. Do you need someone to commit this for you?
vedant
> On Jan 29, 2016, at 4:04 AM, Mario Lang via llvm-commits <llvm-commits at lists.llvm.org> wrote:
>
> Hi.
>
> The YAML IO "Custom scalar" sample code looks wrong.
> It makes use of "T", while "T" is nowhere defined.
>
> diff --git a/docs/YamlIO.rst b/docs/YamlIO.rst
> index f0baeb4..7614679 100644
> --- a/docs/YamlIO.rst
> +++ b/docs/YamlIO.rst
> @@ -456,10 +456,10 @@ looks like:
>
> template <>
> struct ScalarTraits<MyCustomType> {
> - static void output(const T &value, void*, llvm::raw_ostream &out) {
> + static void output(const MyCustomType &value, void*, llvm::raw_ostream &out) {
> out << value; // do custom formatting here
> }
> - static StringRef input(StringRef scalar, void*, T &value) {
> + static StringRef input(StringRef scalar, void*, MyCustomType &value) {
> // do custom parsing here. Return the empty string on success,
> // or an error message on failure.
> return StringRef();
>
> --
> CYa,
> ⡍⠁⠗⠊⠕
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list