1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // class time_put<charT, OutputIterator>
14 // iter_type put(iter_type s, ios_base& str, char_type fill, const tm* t,
15 // const charT* pattern, const charT* pat_end) const;
19 #include "test_iterators.h"
21 typedef std::time_put<char, output_iterator<char*> > F;
27 explicit my_facet(std::size_t refs = 0)
35 output_iterator<char*> iter;
48 std::string pat("Today is %A which is abbreviated %a.");
49 iter = f.put(output_iterator<char*>(str), ios, '*', &t,
50 pat.data(), pat.data() + pat.size());
51 std::string ex(str, iter.base());
52 assert(ex == "Today is Saturday which is abbreviated Sat.");
55 std::string pat("The number of the month is %Om.");
56 iter = f.put(output_iterator<char*>(str), ios, '*', &t,
57 pat.data(), pat.data() + pat.size());
58 std::string ex(str, iter.base());
59 assert(ex == "The number of the month is 05.");