#11855 closed Library Submissions (fixed)
generic gives problems in C++/CLI
Reported by: | Owned by: | Beman Dawes | |
---|---|---|---|
Milestone: | To Be Determined | Component: | filesystem |
Version: | Boost 1.61.0 | Severity: | Problem |
Keywords: | Cc: |
Description
it seems that Boost.Filesystem uyses the name 'generic' with clashes with C++/CLI. I know this is not really a bug, but this is very unhandy and probably makes Boost.Filesystem already unusable in these contexts.
1>c:\boost_1_60_0\boost\filesystem\path.hpp(458): error C2059: syntax error : 'generic'
There is a link on www (can't paste links since trac reports these as spam): 'Visual Studio 2008 error C2059: syntax error : 'generic' '
Change History (11)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
C++/CLI has an extension called __identifier
(See https://msdn.microsoft.com/en-us/library/hzc8ytsz.aspx) that can be used to work around it. Something like the following should work:
#ifdef __cplusplus_cli #define generic __identifier(generic) #endif #include <boost/filesystem.hpp> #ifdef __cplusplus_cli #undef generic #endif
comment:3 by , 7 years ago
i think it is a bad idea (and unnecessary) to use C++/CLI keywords in boost code. it would be nice if it could be fixed for future boost versions.
comment:6 by , 6 years ago
This is still a problem in boost 1.61.0 when compiling with Visual Studio 2015. Please consider the name generic_path() for this function.
comment:8 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in develop. Should be in master in time for 1.63.0.
The old generic() name is deprecated but still supported. It and other deprecated functions can be turned off by defining BOOST_FILESYSTEM_NO_DEPRECATED.
Thanks,
--Beman
comment:10 by , 4 years ago
Hi, Im having the same problem. If I define BOOST_FILESYSTEM_NO_DEPRECATED the code compiles but then I get a runtime exception when the form is initialized.
Any update on this issue, I am also facing same?