/* named_params_example.cpp source file * * Copyright 2004 Cromwell D. Enage. 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) */ /* * Defines the std::ostream class and std::cout, its global instance. */ #include /* * Defines the example function and class templates used in this program. */ #include "named_params_example_header.hpp" int main(int argc, char** argv) { zoo::timbre giraffe_timbre(std::cout, "Munch"); if ( !zoo::make_animal_sound( zoo::timbre_arg = giraffe_timbre , zoo::sound_arg = "Go to sleep." , zoo::silence_arg = "\n" ) ) { std::cout << "I can't hear you!" << std::endl; } std::cout << std::endl; zoo::parrot captain_morgan_jr(std::cout); if ( captain_morgan_jr.make_sound( zoo::sound_arg = "Don't drink and drive!" , zoo::silence_arg = "\n" , zoo::echo_count_arg = 3 , zoo::volume_arg = 0.5f ) ) { std::cout << "Quiet, Captain!" << std::endl; } return 0; }