Skip to content

Update to C++17

Compare
Choose a tag to compare
@wravery wravery released this 07 May 17:42

Highlights from #52:

Adopting C++17

  • Move to PEGTL master/3.0.0 (not yet officially released)
  • Use std::variant for response::Value
  • Replace std::unique_ptr for nullable fields with std::optional

Schemagen improvements

  • Make NYI stub generation optional
  • Split the class definitions/declarations into separate files. May also help with making the NYI stubs optional (i.e. decide whether or not to compile and link them individually).
  • Improve error handling/reporting.
  • Add command line options for things like defining a target directory.
  • Change the names of the generated Mutation accessors to something like applyFieldName. Calling everything getFieldName feels strange when performing a mutation.

Miscellaneous

  • Introduce service::FieldResult which handles returning either by value of T or as a std::future<T>
  • Let the caller specify the std::launch policy for the Request::resolve top-level call.
  • Build a separate library target for the grammar/AST.
  • Replace std::string with std::string_view where appropriate.
  • Replace ast<std::string> with ast<std::vector<char>> to deal with small-string-optimization issues rather than reserving extra space when the string is too short.
  • Replace the facebook::graphql namespace with just graphql for the sake of brevity.