r270237 - in /trunk/libstdc++-v3: ChangeLog inc...

redi@gcc.gnu.org redi@gcc.gnu.org
Tue Apr 9 18:50:00 GMT 2019


Author: redi
Date: Tue Apr  9 18:50:43 2019
New Revision: 270237

URL: https://gcc.gnu.org/viewcvs?rev=270237&root=gcc&view=rev
Log:
Fix std::visit to support arbitrary callables

The __visitor_result_type helper didn't use std::invoke and so didn't
compile when the visitor was a pointer-to-member rather than a function
object. Use std::invoke_result instead.

	* include/std/variant (__variant_idx_cookie): Add member type.
	(__visitor_result_type): Remove.
	(__do_visit): Use invoke_result instead of __visitor_result_type.
	* testsuite/20_util/variant/visit.cc: New test.

Added:
    trunk/libstdc++-v3/testsuite/20_util/variant/visit.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/std/variant



More information about the Libstdc++-cvs mailing list