diff options
Diffstat (limited to 'libcxx/test/std/input.output/iostreams.base/fpos/fpos.operations/subtraction.pass.cpp')
-rw-r--r-- | libcxx/test/std/input.output/iostreams.base/fpos/fpos.operations/subtraction.pass.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libcxx/test/std/input.output/iostreams.base/fpos/fpos.operations/subtraction.pass.cpp b/libcxx/test/std/input.output/iostreams.base/fpos/fpos.operations/subtraction.pass.cpp new file mode 100644 index 00000000000..f9e6513e4a4 --- /dev/null +++ b/libcxx/test/std/input.output/iostreams.base/fpos/fpos.operations/subtraction.pass.cpp @@ -0,0 +1,28 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <ios> + +// template <class StateT> class fpos + +// Subraction with offset + +#include <ios> +#include <cassert> + +int main() +{ + typedef std::fpos<std::mbstate_t> P; + P p(11); + std::streamoff o(6); + P q = p - o; + assert(q == P(5)); + p -= o; + assert(p == q); +} |