[wesnoth-commits] [wesnoth/wesnoth] b5a87f: Unit: converted upkeep handling to std::variant

Charles Dang noreply at github.com
Mon Jan 18 00:27:14 UTC 2021


  Branch: refs/heads/std-variant-test
  Home:   https://github.com/wesnoth/wesnoth
  Commit: b5a87f8d86fe19f8db8c9ead7faf75fbd482a994
      https://github.com/wesnoth/wesnoth/commit/b5a87f8d86fe19f8db8c9ead7faf75fbd482a994
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2021-01-18 (Mon, 18 Jan 2021)

  Changed paths:
    M src/scripting/lua_unit.cpp
    M src/units/filter.cpp
    M src/units/unit.cpp
    M src/units/unit.hpp

  Log Message:
  -----------
  Unit: converted upkeep handling to std::variant

The upkeep_parser_visitor is still boost::variant-compatible since it's used by
const_attribute_value::apply_visitor, and configs still use boost::variant under the hood.

Additionally, these visitors are used in multiple places, so I can't convert them to lambas in-class.

Finally, I used brace-init for the upkeep types and visitors to make it clearer these are not functions.





More information about the Commits mailing list