mirror of
https://github.com/vimpunk/mio.git
synced 2025-12-06 16:57:01 +08:00
Update docs to specify exception type
This commit is contained in:
parent
a345b8b92d
commit
d33a0d567f
@ -20,7 +20,7 @@ NOTE: the file must exist before creating a mapping.
|
||||
|
||||
There are three ways to map a file into memory:
|
||||
|
||||
- Using the constructor, which throws on failure:
|
||||
- Using the constructor, which throws a `std::system_error` on failure:
|
||||
```c++
|
||||
mio::mmap_source mmap(path, offset, size_to_map);
|
||||
```
|
||||
|
||||
@ -104,8 +104,9 @@ public:
|
||||
basic_mmap() = default;
|
||||
|
||||
/**
|
||||
* The same as invoking the `map` function, except any error that may occur while
|
||||
* establishing the mapping is thrown.
|
||||
* The same as invoking the `map` function, except any error that may occur
|
||||
* while establishing the mapping is wrapped in a `std::system_error` and is
|
||||
* thrown.
|
||||
*/
|
||||
template<typename String>
|
||||
basic_mmap(const String& path, const size_type offset = 0, const size_type length = map_entire_file)
|
||||
@ -116,8 +117,9 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* The same as invoking the `map` function, except any error that may occur while
|
||||
* establishing the mapping is thrown.
|
||||
* The same as invoking the `map` function, except any error that may occur
|
||||
* while establishing the mapping is wrapped in a `std::system_error` and is
|
||||
* thrown.
|
||||
*/
|
||||
basic_mmap(const handle_type handle, const size_type offset = 0, const size_type length = map_entire_file)
|
||||
{
|
||||
|
||||
@ -88,8 +88,9 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* The same as invoking the `map` function, except any error that may occur while
|
||||
* establishing the mapping is thrown.
|
||||
* The same as invoking the `map` function, except any error that may occur
|
||||
* while establishing the mapping is wrapped in a `std::system_error` and is
|
||||
* thrown.
|
||||
*/
|
||||
template<typename String>
|
||||
basic_shared_mmap(const String& path, const size_type offset = 0, const size_type length = map_entire_file)
|
||||
@ -100,8 +101,9 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* The same as invoking the `map` function, except any error that may occur while
|
||||
* establishing the mapping is thrown.
|
||||
* The same as invoking the `map` function, except any error that may occur
|
||||
* while establishing the mapping is wrapped in a `std::system_error` and is
|
||||
* thrown.
|
||||
*/
|
||||
basic_shared_mmap(const handle_type handle, const size_type offset = 0, const size_type length = map_entire_file)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user