8000 Modernize codebase: optional instead of out-args · Issue #109 · sipa/miniscript · GitHub
[go: up one dir, main page]

Skip to content

Modernize codebase: optional instead of out-args #109

Open

Description

@sipa

The codebase in several places uses constructions like functions that return a bool to communicate success/failure, and then actually put their output in a by-ref argument, e.g.:

template<typename Ctx> bool ToString(const Ctx& ctx, std::string& ret) const

With the code now using C++17, I think those should be retrofitted to use std::optional instead:

template<typename Ctx> std::optional<std::string> ToString(const Ctx& ctx) const

(and many other examples)

Activity

  1. changed the title [-]Modernize codebase[/-] [+]Modernize codebase: optional instead of out-args[/+] on Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0