1 // (C) Copyright Gennadiy Rozental 2001-2008.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 // See http://www.boost.org/libs/test for the library home page.
9 #include <boost/test/utils/runtime/cla/named_parameter.hpp>
10 #include <boost/test/utils/runtime/cla/parser.hpp>
12 namespace rt
= boost::runtime
;
13 namespace cla
= boost::runtime::cla
;
19 char* argv
[] = { "basic" };
20 int argc
= sizeof(argv
)/sizeof(char*);
25 P
<< cla::named_parameter
<int>( "abcd" ) - ( cla::default_value
= 10 );
27 P
.parse( argc
, argv
);
29 std::cout
<< "abcd = " << P
.get
<int>( "abcd" ) << std::endl
;
31 catch( rt::logic_error
const& ex
) {
32 std::cout
<< "Logic error: " << ex
.msg() << std::endl
;