Summary: | Usage of "using std::size_t;" in Eigen/Core | ||
---|---|---|---|
Product: | Eigen | Reporter: | patrikhuber |
Component: | Core - general | Assignee: | Nobody <eigen.nobody> |
Status: | RESOLVED FIXED | ||
Severity: | Unknown | CC: | chtz, gael.guennebaud, jacob.benoit.1 |
Priority: | Normal | ||
Version: | 3.3 (current stable) | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: |
Description
patrikhuber
2017-01-23 13:55:50 UTC
I do agree, though on my computers (OSX,Linux) using either gcc, clang, or icc, the following compile fine: #include <cstddef> int main() { size_t x = 2; return x; } so this won't make any difference except on QNX and perhaps some other exotic platforms. Since we cannot test Eigen of those platforms, we need a way to make sure that writing size_t instead of std::size_t fails to compile. Any idea? Could we just move the using std::size_t inside our namespace Eigen { }? Or would this fail if we are in some sub-namespace of Eigen? (In reply to Christoph Hertzberg from comment #2) > Could we just move the using std::size_t inside our namespace Eigen { }? > Or would this fail if we are in some sub-namespace of Eigen? yes, this could work. Here you go: https://bitbucket.org/eigen/eigen/commits/44f398045cff/ (devel) https://bitbucket.org/eigen/eigen/commits/b8de228d7a96/ (3.3) Summary: Add std:: namespace prefix to all (hopefully) instances if size_t/ptrdfiff_t https://bitbucket.org/eigen/eigen/commits/f84b7350a9e2/ (devel) https://bitbucket.org/eigen/eigen/commits/8c963af45ab1/ (3.3) Summary: Bug 1382: move using std::size_t/ptrdiff_t to Eigen's namespace (still better than the global namespace!) If someone as a suggestion to safely get rid of the using namespace statements or has issues with the new approach (using std::size_t/ptrdiff_t within Eigen namespace), feel free to re-open. -- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1382. |