From 4084e5543075fcc542ff6dfd10b26b929831f848 Mon Sep 17 00:00:00 2001 From: mandreyel Date: Thu, 5 Oct 2017 16:37:30 +0200 Subject: [PATCH] fixed comments, typedefs --- include/mio/mmap.hpp | 3 ++- test/test.cpp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/mio/mmap.hpp b/include/mio/mmap.hpp index 35cea4c..7069ce3 100644 --- a/include/mio/mmap.hpp +++ b/include/mio/mmap.hpp @@ -29,7 +29,6 @@ namespace mio { // This is used by basic_mmap to determine whether to create a read-only or a read-write // memory mapping. The two possible values are `read_only` and `read_write`. -// TODO try to better expose these values using detail::access_mode; // This value may be provided as the `length` parameter to the constructor or @@ -298,12 +297,14 @@ template< typename CharTraits = std::char_traits > using basic_mmap_sink = basic_mmap; +/** These aliases should cover the most common use cases. */ using mmap_source = basic_mmap_source; using ummap_source = basic_mmap_source; using mmap_sink = basic_mmap_sink; using ummap_sink = basic_mmap_sink; +/** Convenience factory method that constructs a mapping for any basic_mmap<> type. */ template< typename MMap, typename MappingToken diff --git a/test/test.cpp b/test/test.cpp index efa949b..56e2791 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -68,5 +68,8 @@ int main() m = mio::make_mmap_source(path, 100 * buffer.size(), buffer.size(), error); CHECK_INVALID_MMAP(m); + // Just making sure custom types compile. + mio::ummap_source ummap; + std::printf("all tests passed!\n"); }