| |

VerySource

 Forgot password?
 Register
Search
Author: yangjmkm

C ++ template problem

[Copy link]

0

Threads

36

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

Post time: 2020-1-25 12:18:02
| Show all posts
template <class T1, class T2>
class CTypeObject
{
    map <string, CTypeObject <T2 >> m_Object;
};

Don't know if it meets your requirements?
Reply

Use magic Report

0

Threads

24

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-1-25 12:54:01
| Show all posts
template class <T> map <string, CTypeObject <T >> m_Object;
-------------------------------------------------- --------------------------------
template class <T> map <string, CTypeObject <T>> m_Object; // Note that there is an extra space
This space is sometimes necessary, because consecutive ">>" s are interpreted by the compiler as operator >>, so a space needs to be added.
However, many compilers can parse out what you mean even if you don't add spaces.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list