Я пытаюсь обновить проект с VC2010 до VC2015.И я получил некоторые ошибки компиляции.Я решил кое-что из этого.Есть некоторые ошибки остаются.Эта ошибка произошла в хронографическом источнике VC2015.Я не могу найти, как это исправить.
Есть ли какие-либо изменения в синтаксисе C ++?Как исправить ошибки.
Ниже приведены сообщения об ошибках.Я получил около 6000 ошибок.Но я удаляю дубликат.Я добавил исходный код хроно.
Severity Code Description Project File Line
Error C2332 'class': missing tag name MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 384
Error C2993 '': illegal type for non-type template parameter '<unnamed-tag>' MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 384
Error C2059 syntax error: 'string' MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 384
Error C2974 'std::is_convertible': invalid template argument for '_To', type expected MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 387
Error C2955 'std::is_convertible': use of class template requires template argument list MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 387
Error C2143 syntax error: missing ';' before '{' MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 389
Error C2447 '{': missing function header (old-style formal list?) MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 389
Error C2332 'class': missing tag name MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 393
Error C2993 '': illegal type for non-type template parameter '<unnamed-tag>' MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 393
Error C2059 syntax error: 'string' MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 393
Error C2143 syntax error: missing ';' before '{' MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 397
Error C2447 '{': missing function header (old-style formal list?) MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 397
Error C2143 syntax error: missing ',' before '<' MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 412
Error C2518 keyword 'typename' illegal in base class list; ignored MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 412
Error C2976 'std::chrono::_Duration_div_mod': too few template arguments MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 420
Error C2144 syntax error: 'int' should be preceded by ';' MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 421
Error C2433 'type': 'inline' not permitted on data declarations MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 421
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 421
Error C2065 '_Rep1': undeclared identifier MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 422
Error C2065 '_Period1': undeclared identifier MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 422
Error C2923 'std::chrono::duration': '_Rep1' is not a valid template type argument for parameter '_Rep' MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 422
Error C2923 'std::chrono::duration': '_Period1' is not a valid template type argument for parameter '_Period' MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 422
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 423
Error C2988 unrecognizable template declaration/definition MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 423
Error C2143 syntax error: missing ',' before '&' MyProject_VS2015 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono 423
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\chrono
384 template<class _CR,
385 class _Period1,
386 class _Rep2,
387 bool = is_convertible<_Rep2, _CR>::value>
388 struct _Duration_div_mod1
389 { // return type for duration / rep and duration % rep
390 typedef duration<_CR, _Period1> type;
391 };
392
393 template<class _CR,
394 class _Period1,
395 class _Rep2>
396 struct _Duration_div_mod1<_CR, _Period1, _Rep2, false>
397 { // no return type
398 };
408 template<class _Rep1,
409 class _Period1,
410 class _Rep2>
411 struct _Duration_div_mod<_Rep1, _Period1, _Rep2, false>
412 : _Duration_div_mod1<typename common_type<_Rep1, _Rep2>::type,
413 _Period1, _Rep2>
414 { // return type for duration / rep and duration % rep
415 };
416
417 template<class _Rep1,
418 class _Period1,
419 class _Rep2> inline
420 typename _Duration_div_mod<_Rep1, _Period1, _Rep2>::type
421 constexpr operator/(
422 const duration<_Rep1, _Period1>& _Left,
423 const _Rep2& _Right)
424 { // divide duration by rep
425 typedef typename common_type<_Rep1, _Rep2>::type _CR;
426 typedef duration<_CR, _Period1> _CD;
427 return (_CD(_CD(_Left).count() / _Right));
428 }