Mercurial > ecos
view packages/language/cxx/ustl/current/tests/bvt19.cpp @ 2961:4d0db334c7fc
* include/*, tests/*, HISTORY, LICENSE: Update to uSTL 1.4 sources.
| author | jld |
|---|---|
| date | Tue, 29 Jun 2010 07:30:28 +0000 |
| parents | 88af52c64ce4 |
| children | 4885e0722884 |
line wrap: on
line source
// This file is part of the uSTL library, an STL implementation. // // Copyright (c) 2005-2009 by Mike Sharov <msharov@users.sourceforge.net> // This file is free software, distributed under the MIT License. #include "stdtest.h" void TestEnumArithmetic (void) { enum EFruit { apple, orange, plum, peach, pear, nectarine, NFruits }; const char* fruits [NFruits + 1] = { "apple", "orange", "plum", "peach", "pear", "nectarine", "invalid" }; cout << "Testing operator+" << endl; cout << "apple = " << fruits [apple] << endl; cout << "peach = " << fruits [apple + 3] << endl; } StdBvtMain (TestEnumArithmetic)
