Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/test/example/env/environment_ex.cpp @ 20

Last change on this file since 20 was 12, checked in by landauf, 17 years ago

added boost

  • Property svn:executable set to *
File size: 771 bytes
Line 
1//  (C) Copyright Gennadiy Rozental 2001-2005.
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)
5
6//  See http://www.boost.org/libs/test for the library home page.
7
8// Boost.Runtime.Param
9#include <boost/test/utils/runtime/env/variable.hpp>
10#include <boost/test/utils/basic_cstring/io.hpp>
11
12namespace rt  = boost::runtime;
13namespace env = boost::runtime::env;
14
15// STL
16#include <iostream>
17
18int main() {
19    std::cout << env::get<int>("NUMBER_OF_PROCESSORS") << '\n' << env::get<rt::cstring>("TEMP") << std::endl;
20
21    boost::optional<int> n;
22
23    env::get( "NUMBER_OF_PROCESSORS", n );
24
25    if( n )
26        std::cout << n << std::endl;
27
28    return 0;
29}
30
31// EOF
32
Note: See TracBrowser for help on using the repository browser.