[wesnoth-commits] [wesnoth/wesnoth] 67024f: Added a new config::optional_child function

Charles Dang noreply at github.com
Wed Jan 27 15:51:35 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 67024f29a19d38028e8389fb5926f2f930bb85fb
      https://github.com/wesnoth/wesnoth/commit/67024f29a19d38028e8389fb5926f2f930bb85fb
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2021-01-28 (Thu, 28 Jan 2021)

  Changed paths:
    M src/config.cpp
    M src/config.hpp
    A src/utils/optional_reference.hpp

  Log Message:
  -----------
  Added a new config::optional_child function

This is intended to replace uses of config::child that may fail, since we eventually want to get rid
of that ugly "invalid config" and the dreaded "Mandatory child missing yet untested for" error.

Both config::child and config::find_child had new optional throw-if-not-found behavior added, enabled
by an instance of config::throw_when_child_not_found.


  Commit: 5de1f8d5ccda92e6e02df84146e85fd84d8fb241
      https://github.com/wesnoth/wesnoth/commit/5de1f8d5ccda92e6e02df84146e85fd84d8fb241
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2021-01-28 (Thu, 28 Jan 2021)

  Changed paths:
    M src/server/campaignd/server.cpp

  Log Message:
  -----------
  Campaignd: deployed an example use of config::optional_child


Compare: https://github.com/wesnoth/wesnoth/compare/efefcd2284b2...5de1f8d5ccda



More information about the Commits mailing list