thrust / dependencies /libcudacxx /libcxx /test /std /diagnostics /syserr /syserr.errcode /syserr.errcode.modifiers /assign.pass.cpp
Download dependencies/libcudacxx/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/assign.pass.cpp from camenduru/thrust: direct link, hf CLI and curl.
- Browser
- Download file 926 Bytes
-
https://huggingface.co/camenduru/thrust/resolve/main/dependencies/libcudacxx/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/assign.pass.cpp
- Command line
-
hf download hf://camenduru/thrust/dependencies/libcudacxx/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/assign.pass.cpp
-
curl -L -o assign.pass.cpp https://huggingface.co/camenduru/thrust/resolve/main/dependencies/libcudacxx/libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.modifiers/assign.pass.cpp
926 Bytes
| //===----------------------------------------------------------------------===// | |
| // | |
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| // See https://llvm.org/LICENSE.txt for license information. | |
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| // | |
| //===----------------------------------------------------------------------===// | |
| // <system_error> | |
| // class error_code | |
| // void assign(int val, const error_category& cat); | |
| int main(int, char**) | |
| { | |
| { | |
| std::error_code ec; | |
| ec.assign(6, std::system_category()); | |
| assert(ec.value() == 6); | |
| assert(ec.category() == std::system_category()); | |
| } | |
| { | |
| std::error_code ec; | |
| ec.assign(8, std::generic_category()); | |
| assert(ec.value() == 8); | |
| assert(ec.category() == std::generic_category()); | |
| } | |
| return 0; | |
| } | |