// Copyright (c) 2018 Emil Dotchevski // Copyright (c) 2018 Second Spectrum, Inc. // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include namespace leaf = boost::leaf; template typename leaf::leaf_detail::deduce_static_store::type>::type * expd( Handler && ... ) { return 0; } template void test( U * ) { static_assert(std::is_same::value,"static_store_deduction"); } template struct info { int value; }; enum class my_error_code { ok, error1, error2, error3 }; namespace boost { namespace leaf { template <> struct is_e_type: std::true_type { }; } } void not_called_on_purpose() { using leaf::leaf_detail::static_store; test< static_store> >( expd([ ]( info<1> ){ }) ); test< static_store> >( expd([ ]( info<1> const ){ }) ); test< static_store> >( expd([ ]( info<1> const & ){ }) ); test< static_store> >( expd([ ]( info<1>, leaf::error_info const & ){ }) ); test< static_store,info<2>> >( expd([ ]( info<1> ){ }, [ ]( info<2> ){ }) ); test< static_store,info<2>> >( expd([ ]( info<1> ){ }, [ ]( info<1>, info<2> ){ }) ); test< static_store,info<2>> >( expd([ ]( info<1>, info<2> ){ }, [ ]( info<2> ){ }) ); test< static_store,info<2>> >( expd([ ]( info<1>, info<2> ){ }, [ ]( info<1>, info<2> ){ }) ); test< static_store,info<2>> >( expd([ ]( leaf::error_info const &, info<1> ){ }, [ ]( info<2> ){ }) ); test< static_store,info<2>> >( expd([ ]( leaf::error_info const &, info<1> ){ }, [ ]( info<1>, info<2> ){ }) ); test< static_store,info<2>> >( expd([ ]( leaf::error_info const &, info<1>, info<2> ){ }, [ ]( info<2> ){ }) ); test< static_store,info<2>> >( expd([ ]( leaf::error_info const &, info<1>, info<2> ){ }, [ ]( info<1>, info<2> ){ }) ); test< static_store,info<2>> >( expd([ ]( info<1>, leaf::error_info const & ){ }, [ ]( info<2> ){ }) ); test< static_store,info<2>> >( expd([ ]( info<1>, leaf::error_info const & ){ }, [ ]( info<1>, info<2> ){ }) ); test< static_store,info<2>> >( expd([ ]( info<1>, leaf::error_info const &, info<2> ){ }, [ ]( info<2> ){ }) ); test< static_store,info<2>> >( expd([ ]( info<1>, leaf::error_info const &, info<2> ){ }, [ ]( info<1>, info<2> ){ }) ); test< static_store,info<2>> >( expd([ ]( info<1> ){ }, [ ]( leaf::error_info const &, info<2> ){ }) ); test< static_store,info<2>> >( expd([ ]( info<1> ){ }, [ ]( leaf::error_info const &, info<1>, info<2> ){ }) ); test< static_store,info<2>> >( expd([ ]( info<1>, info<2> ){ }, [ ]( leaf::error_info const &, info<2> ){ }) ); test< static_store,info<2>> >( expd([ ]( info<1>, info<2> ){ }, [ ]( leaf::error_info const &, info<1>, info<2> ){ }) ); test< static_store,info<2>> >( expd([ ]( info<1> ){ }, [ ]( info<2>, leaf::error_info const & ){ }) ); test< static_store,info<2>> >( expd([ ]( info<1> ){ }, [ ]( info<1>, leaf::error_info const &, info<2> ){ }) ); test< static_store,info<2>> >( expd([ ]( info<1>, info<2> ){ }, [ ]( info<2>, leaf::error_info const & ){ }) ); test< static_store,info<2>> >( expd([ ]( info<1>, info<2> ){ }, [ ]( info<1>, leaf::error_info const &, info<2> ){ }) ); test< static_store,info<2>,info<3>> >( expd([ ]( info<1> ){ }, [ ]( info<2> ){ }, [ ]( info<3> ){ }) ); test< static_store,info<2>,info<3>> >( expd([ ]( info<1> ){ }, [ ]( info<1>, info<2> ){ }, [ ]( info<1>, info<3> ){ }) ); test< static_store,info<2>,info<3>> >( expd([ ]( info<1> ){ }, [ ]( info<1>, info<2> ){ }, [ ]( info<1>, info<3> ){ }) ); test< static_store,info<2>,info<3>> >( expd([ ]( info<1>, info<2> ){ }, [ ]( info<2> ){ }, [ ]( info<3> ){ }) ); test< static_store,info<2>,info<3>> >( expd([ ]( info<1>, info<2> ){ }, [ ]( info<2> ){ }, [ ]( info<3> ){ }) ); test< static_store,info<2>,info<3>> >( expd([ ]( info<1> ){ }, [ ]( info<2> ){ }, [ ]( info<3>, info<2> ){ }) ); test< static_store,info<2>,info<3>> >( expd([ ]( info<1> ){ }, [ ]( info<2> ){ }, [ ]( info<3>, info<2> ){ }) ); test< static_store,info<3>,info<2>> >( expd([ ]( info<1>, info<3> ){ }, [ ]( info<2> ){ }, [ ]( info<3> ){ }) ); test< static_store,info<3>,info<2>> >( expd([ ]( info<1>, info<3> ){ }, [ ]( info<2> ){ }, [ ]( info<3> ){ }) ); test< static_store,info<2>,info<3>> >( expd([ ]( info<1> ){ }, [ ]( info<2>, info<3> ){ }, [ ]( info<3> ){ }) ); test< static_store,info<2>,info<3>> >( expd([ ]( info<1> ){ }, [ ]( info<2>, info<3> ){ }, [ ]( info<3> ){ }) ); test< static_store >( expd([ ]( leaf::match ){ }) ); test< static_store> >( expd([ ]( leaf::match,42> ){ }) ); test< static_store> >( expd([ ]( leaf::catch_, info<1> ){ }) ); test< static_store,info<2>,info<3>> >( expd([ ]( info<1> const *, info<2> ){ }, [ ]( info<1>, info<3> const * ){ }) ); test< static_store,info<2>,info<3>> >( expd([ ]( info<1> const, info<2> ){ }, [ ]( info<1> const *, info<3> ){ }) ); } int main() { return 0; }