[wesnoth-commits] [wesnoth/wesnoth] 577000: GUI2: reimplemented [dis]connect_signal SFINAE usi...

GitHub noreply at github.com
Fri Mar 23 07:54:48 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 57700090d898d90766c7b0849020f9af696c55ed
      https://github.com/wesnoth/wesnoth/commit/57700090d898d90766c7b0849020f9af696c55ed
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-03-23 (Fri, 23 Mar 2018)

  Changed paths:
    M src/gui/core/event/dispatcher.cpp
    M src/gui/core/event/dispatcher.hpp

  Log Message:
  -----------
  GUI2: reimplemented [dis]connect_signal SFINAE using constexpr functions

This replaces the use of the boost::mpl::set lists. It replaces those damn things with simple
constexpr functions that check the template parameter against an accepted list for each event
type. This is a *lot* simpler.

These helpers are also used in the runtime checks in dispatcher::fire.

I've had to leave the mpl sets in, though, since I can't figure out how to convert the last
place where they're used. The presence of a type is required for SFINAE in
dispatcher_implementation::event_signal, and I can't figure out a new design that avoids the
need for the template parameters.




More information about the Commits mailing list