You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int fid = ::open(fname.c_str(), O_RDONLY);
mio::mmap_source data_mmap(fid, size_t(0), size_t(1000000));
which should use the 2nd form of the constructor. However, with visual studio I get this error:
FAILED: CMakeFiles/read_archive.dir/read_archive.cpp.obj
C:\PROGRA~2\MICROS~2\2019\PROFES~1\VC\Tools\MSVC\1429~1.301\bin\HostX64\x64\cl.exe /nologo /TP -DNOMINMAX -DWIN32_LEAN_AND_MEAN -D_USE_MATH_DEFINES -IC:\src\..\..\3rdparty\json\include -IC:\src\..\..\3rdparty\sha2-1.0.1 -IC:\src\..\..\3rdparty\mio-master\single_include -IC:\src\..\..\install\include /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++17 /showIncludes /FoCMakeFiles\read_archive.dir\read_archive.cpp.obj /FdCMakeFiles\read_archive.dir\ /FS -c C:\src\read_archive.cpp
C:\src\read_archive.cpp(55): warning C4996: 'open': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _open. See online help for details.
C:\src\..\..\3rdparty\mio-master\single_include\mio/mio.hpp(1045): error C2672: 'mio::detail::empty': no matching overloaded function found
C:\src\..\..\3rdparty\mio-master\single_include\mio/mio.hpp(199): note: see reference to function template instantiation 'void mio::basic_mmap<mio::access_mode::read,char>::map<String>(const String &,const mio::basic_mmap<mio::access_mode::read,char>::size_type,const mio::basic_mmap<mio::access_mode::read,char>::size_type,std::error_code &)' being compiled
with
[
String=int
]
C:\src\..\..\3rdparty\mio-master\single_include\mio/mio.hpp(199): note: see reference to function template instantiation 'void mio::basic_mmap<mio::access_mode::read,char>::map<String>(const String &,const mio::basic_mmap<mio::access_mode::read,char>::size_type,const mio::basic_mmap<mio::access_mode::read,char>::size_type,std::error_code &)' being compiled
with
[
String=int
]
C:\src\read_archive.cpp(57): note: see reference to function template instantiation 'mio::basic_mmap<mio::access_mode::read,char>::basic_mmap<int>(const String &,const mio::basic_mmap<mio::access_mode::read,char>::size_type,const mio::basic_mmap<mio::access_mode::read,char>::size_type)' being compiled
with
[
String=int
]
C:\src\read_archive.cpp(57): note: see reference to function template instantiation 'mio::basic_mmap<mio::access_mode::read,char>::basic_mmap<int>(const String &,const mio::basic_mmap<mio::access_mode::read,char>::size_type,const mio::basic_mmap<mio::access_mode::read,char>::size_type)' being compiled
with
[
String=int
]
C:\src\..\..\3rdparty\mio-master\single_include\mio/mio.hpp(1045): error C2783: 'bool mio::detail::empty(const String &)': could not deduce template argument for '<unnamed-symbol>'
C:\src\..\..\3rdparty\mio-master\single_include\mio/mio.hpp(743): note: see declaration of 'mio::detail::empty'
ninja: build stopped: subcommand failed.
From what I can tell, it's trying to use the first constructor form; it's using String=int as the template specialization!
This isn't exactly a bug, since I can clearly use the first constructor form directly (passing fname as the first argument). However, I started to think that it's actually a bad idea to have 2 constructor forms that are identical except for one argument, which is templated ... doesn't that just scream ambiguity??
My suggestion would be to eliminate (well, deprecate) the 2nd constructor form, and instead create a static method with a descriptive name like fromFileHandle(int, size_t, size_t).
And -- thank you for producing this project.
The text was updated successfully, but these errors were encountered:
Hello,
The following code worked great for g++ 11.2.0
which should use the 2nd form of the constructor. However, with visual studio I get this error:
From what I can tell, it's trying to use the first constructor form; it's using
String=int
as the template specialization!This isn't exactly a bug, since I can clearly use the first constructor form directly (passing
fname
as the first argument). However, I started to think that it's actually a bad idea to have 2 constructor forms that are identical except for one argument, which is templated ... doesn't that just scream ambiguity??My suggestion would be to eliminate (well, deprecate) the 2nd constructor form, and instead create a static method with a descriptive name like
fromFileHandle(int, size_t, size_t)
.And -- thank you for producing this project.
The text was updated successfully, but these errors were encountered: