分配操作员 [英] Assignment operator

查看:83
本文介绍了分配操作员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何在重载此运算符后使用默认赋值运算符(逐个成员赋值)?

我想访问原始版本的assigment运算符(=),

但我不知道暗示编译器使用默认版本而不使用重载版本的语法。

解决方案

< blockquote>我不知道你想用operator =做什么。它通常不会被覆盖,并且选择特定的operator ='听起来很麻烦。


你能举例说明你想要做什么吗?


我有这样的代码:

展开 | 选择 | Wrap | 行号


这可能对您有所帮助;但是有一些错误:

展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号


Hi,
How can i use default assignment operator (member-by-member assignment) after overloading this operator?
I want to access orginal version of assigment operator (=),
but i don''t know the syntax that imply compiler to use default version and not to use overload version.

解决方案

I''m not sure what you want to do with operator=. It''s not usually overwritten and picking specific operator=''s sounds like trouble.

Can you give an example of what you''re trying to do?


I have code like this:

Expand|Select|Wrap|Line Numbers


This maybe will help you; But there were some errors:

Expand|Select|Wrap|Line Numbers


这篇关于分配操作员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆