- Visual C++ 2019 is having a hissy fit over these two lines of code - 15 Updates
- "C++ on the Move" by Darryl K. Taft - 3 Updates
- Is this safe? - 1 Update
- More of my philosophy about Bonita Montero and about my new proverb and about mathematics and about performance and reliability and about fluid intelligence and about Leadership and about efficiency and about reliability and about the digital ide - 2 Updates
- More of my philosophy about my previous post to Bonita Montero... - 1 Update
Lynn McGuire <lynnmcguire5@gmail.com>: Jul 19 09:46PM -0500 And Visual C++ 2019 is having a hissy fit over these two lines of code: static const size_t size_t_max = std::numeric_limits<size_t>::max(); static const ssize_t ssize_t_max = std::numeric_limits<ssize_t>::max(); That code worked just fine in Visual C++ 2015. What am I screwing up here ? Thanks, Lynn |
Lynn McGuire <lynnmcguire5@gmail.com>: Jul 19 09:48PM -0500 On 7/19/2023 9:46 PM, Lynn McGuire wrote: > here ? > Thanks, > Lynn You know, I should give the error code: Severity Code Description Project File Line Suppression State Error C2440 'initializing': cannot convert from 'unsigned int (__cdecl *)(void) noexcept' to 'fem::size_t' dii_c_library C:\dii\inc\fem\size_t.hpp 12 And here is the file: #ifndef FEM_SIZE_T_HPP #define FEM_SIZE_T_HPP #include <limits> #include <cstddef> namespace fem { typedef std::size_t size_t; typedef std::ptrdiff_t ssize_t; static const size_t size_t_max = std::numeric_limits<size_t>::max(); static const ssize_t ssize_t_max = std::numeric_limits<ssize_t>::max(); template <typename T> struct array_of_2 { T elems[2]; array_of_2() {} array_of_2(T const& i, T const& j) { elems[0] = i; elems[1] = j; } }; typedef array_of_2<size_t> size_t_2; typedef array_of_2<ssize_t> ssize_t_2; } // namespace fem
Subscribe to:
Post Comments (Atom)
|
No comments:
Post a Comment