阅读背景:

c ++ push_back,非const复制构造函数

来源:互联网 

I have a class that i want to push_back into a deque. The problem is when i push back i need the original object to be changed thus i need a non const copy ctor. Now if i implement that my const copy ctor gets called. If i removed the const ctor i get an compile error about no available ctors. How do i implement this in a way that i can modify the original struct when i pass it in? i need to modify it bc the class destructs objects when it goes out of scope and i would like to tell it not to do so when there is another instance around. I cant use boost since my platform doesnt support it.I have a class that i want to push_back into a




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: