2
0
mirror of https://github.com/boostorg/compute.git synced 2026-02-18 14:02:13 +00:00

if the ifstream can't be created in program::create_with_source_file then it throws std::ios_base::failure.

This commit is contained in:
Alex Olivas
2015-11-18 16:27:19 -07:00
parent c75f5dc858
commit 0a2d7fa0e1
2 changed files with 14 additions and 0 deletions

View File

@@ -394,6 +394,10 @@ public:
// open file stream
std::ifstream stream(file.c_str());
if(stream.fail()){
BOOST_THROW_EXCEPTION(std::ios_base::failure("failed to create stream."));
}
// read source
std::string source(
(std::istreambuf_iterator<char>(stream)),