[dbus-c++] rearrange some deckchairs in types.h

clang requires that when you invoke an operator with type-based dispatch, the
variant for the type you are invoking it on has already been pre-declared; this
bites us in the Variant T() operator, which relies on the overloaded '>>'
operator for MessageIter; we invoke >> on some type T, but >> for T is declared
later in the file.

To hack around this, switch over to just forward-declaring the existence of the
T() operator, and put the body of the T() operator after all the
declarations/definitions of MessageIter >> operators. Also, shuffle the Variant
MessageIter >> operator to be above the map >> operator, since if someone tries
to invoke >> on a map of variants, they'll have the same problem.

There will probably be other, similar problems requiring more rearrangements in
future.

BUG=chromium-os:37776
TEST=trybot

Change-Id: I024ec58d427d960372d92ecaa48f711b4569778f
Signed-off-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41576
Reviewed-by: Guozhi Wei <carrot@google.com>
Reviewed-by: Ryan Sleevi <rsleevi@chromium.org>
1 file changed