parameter/test/literate/top-level0.cpp
CromwellEnage 01be812580 Update literate tests and tutorial documentation
* Fix compiler failures showing up on regression test matrix due to void return type.
* Fix gcc-3.4 failures showing up regression test matrix due to binding string literals to non-const references to char const*.
* Update tutorial documentation to match literate tests.
2019-01-01 05:27:18 -05:00

58 lines
1.0 KiB
C++

#include <boost/parameter.hpp>
namespace test {
BOOST_PARAMETER_NAME(title)
BOOST_PARAMETER_NAME(width)
BOOST_PARAMETER_NAME(titlebar)
BOOST_PARAMETER_FUNCTION((int), new_window, tag,
(required (title,*)(width,*)(titlebar,*))
)
{
return 0;
}
BOOST_PARAMETER_TEMPLATE_KEYWORD(deleter)
BOOST_PARAMETER_TEMPLATE_KEYWORD(copy_policy)
template <typename T>
struct Deallocate
{
};
struct DeepCopy
{
};
struct Foo
{
};
template <typename T, typename A0, typename A1>
struct smart_ptr
{
smart_ptr(test::Foo*)
{
}
};
}
#include <boost/core/lightweight_test.hpp>
int main()
{
char const* alert_s = "alert";
int x = test::new_window(alert_s, test::_width=10, test::_titlebar=false);
test::Foo* foo = new test::Foo();
test::smart_ptr<
test::Foo
, test::deleter<test::Deallocate<test::Foo> >
, test::copy_policy<test::DeepCopy>
> p(foo);
delete foo;
return boost::report_errors();
}