expected_types

Synopsis

template <class FormatString>
struct expected_types
{
  // unspecified
};

Description

FormatString is a string representing a printf format string. The function returns the list of argument types the format string expects. The types are boxed using Metamonad's boxing wrapper.

#include <mpllibs/safe_printf/expected_types.hpp>

Expression semantics

For any s boost::metaparse::string:

mpllibs::safe_printf::expected_types<s>::type

is the list of types printf needs after the format string. The types are wrapped with mpllibs::metamonad::box.

Example

using mpllibs::metamonad::box;

BOOST_STATIC_ASSERT((
  boost::mpl::equal<
    mpllibs::safe_printf::expected_types<
      BOOST_METAPARSE_STRING("%d %d\n")
    >::type,
    boost::mpl::vector<box<int>, box<int>>
  >::type::value
));

[up]