1 //===----------------------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // <ios> 10 11 // template <class charT, class traits> class basic_ios 12 13 // explicit basic_ios(basic_streambuf<charT,traits>* sb); 14 15 #include <ios> 16 #include <streambuf> 17 #include <cassert> 18 19 int main(int, char**) 20 { 21 { 22 std::streambuf* sb = 0; 23 std::basic_ios<char> ios(sb); 24 assert(ios.rdbuf() == sb); 25 assert(ios.tie() == 0); 26 assert(ios.rdstate() == std::ios::badbit); 27 assert(ios.exceptions() == std::ios::goodbit); 28 assert(ios.flags() == (std::ios::skipws | std::ios::dec)); 29 assert(ios.width() == 0); 30 assert(ios.precision() == 6); 31 assert(ios.fill() == ' '); 32 assert(ios.getloc() == std::locale()); 33 } 34 { 35 std::streambuf* sb = (std::streambuf*)1; 36 std::basic_ios<char> ios(sb); 37 assert(ios.rdbuf() == sb); 38 assert(ios.tie() == 0); 39 assert(ios.rdstate() == std::ios::goodbit); 40 assert(ios.exceptions() == std::ios::goodbit); 41 assert(ios.flags() == (std::ios::skipws | std::ios::dec)); 42 assert(ios.width() == 0); 43 assert(ios.precision() == 6); 44 assert(ios.fill() == ' '); 45 assert(ios.getloc() == std::locale()); 46 } 47 48 return 0; 49 } 50