[#BloombergLP-bslmf-operator_comma] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmf.adoc[bslmf]::operator, :relfileprefix: ../../ :mrdocs: Detect non‐void expressions via an overloaded comma operator. == Synopsis Declared in `<bslmf_invokeresult.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_TYPE> xref:BloombergLP/bslmf/Tag-0b.adoc[Tag<false>] operator,( t_TYPE const& value, xref:BloombergLP/bslmf/InvokeResult_VoidChecker.adoc[InvokeResult_VoidChecker] checker) requires !bsl::is_void<t_TYPE>::value; ---- == Description Return `InvokeResult_VoidChecker()` if the left argument is of type cv‐`void`; otherwise `bslmf::Tag<false>()`. This overload of the comma operator is declared but not defined, and is intended to be used in metafunctions in an unevaluated context to detect void expressions. For any non‐void expression `expr`, `(expr,InvokeResult_VoidChecker())`, will match this overload and produce a result of type `bslmf::Tag<false>`. However, `const t_TYPE&` will not match `void`, so if `expr` is a void expression, the built‐in comma operator is matched and the result will have type `InvokeResult_VoidChecker` (i.e., the second argument). Note that Sun CC incorrectly matches this overload for a void expression, then fails hard. The `enable_if` prevents this match for Sun CC and any other compilers that may similarly match `void` and is harmless for compilers that don't. == Return Value `Tag<false>` indicating a non‐void left‐hand operand == Parameters [cols="1,4"] |=== | Name| Description | *value* | non‐void left‐hand operand of the comma expression | *checker* | right‐hand void‐detection tag |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#