trivariant => optional_variant

this patch replaces trivariant with optional_variant which can offer the
same semantics when used as optional_variant<void,...>