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:
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user