Author: sebor Date: Thu Mar 20 10:12:00 2008 New Revision: 639361 URL: http://svn.apache.org/viewvc?rev=639361&view=rev Log: 2008-03-20 Martin Sebor STDCXX-789 * examples/manual/random_shuffle.cpp (main): Set fixed floating point format to suppress the decimal point in iostream output. Modified: stdcxx/trunk/examples/manual/random_shuffle.cpp Modified: stdcxx/trunk/examples/manual/random_shuffle.cpp URL: http://svn.apache.org/viewvc/stdcxx/trunk/examples/manual/random_shuffle.cpp?rev=639361&r1=639360&r2=639361&view=diff ============================================================================== --- stdcxx/trunk/examples/manual/random_shuffle.cpp (original) +++ stdcxx/trunk/examples/manual/random_shuffle.cpp Thu Mar 20 10:12:00 2008 @@ -22,23 +22,24 @@ * implied. See the License for the specific language governing * permissions and limitations under the License. * - * Copyright 1994-2006 Rogue Wave Software. + * Copyright 1994-2008 Rogue Wave Software, Inc. * **************************************************************************/ #include // for random_shuffle -#include // for cout, endl +#include // for cout #include // for ostream_iterator #include // for string -#include +// #include int main () { // Create a string of doubles (unusual? maybe, but why not...) - typedef std::basic_string, - std::allocator > Bizarre; + typedef std::char_traits Traits; + typedef std::allocator Allocator; + typedef std::basic_string Bizarre; // Initialize a Bizarre with an array of values. const Bizarre::value_type a[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; @@ -50,6 +51,7 @@ // Suppress decimal point in output. std::cout.precision (0); + std::cout.setf (std::cout.fixed, std::cout.floatfield); // Print out elements in original (sorted) order. std::cout << "Elements before random_shuffle: \n "; @@ -61,7 +63,7 @@ // Print out the mixed up elements. std::cout << "\n\nElements after random_shuffle: \n "; std::copy (b.begin (), b.end (), Iter (std::cout, " ")); - std::cout << std::endl; + std::cout << '\n'; return 0; }