English 中文(简体)
C和C++中是否有实际操作者?
原标题:Are . and -> in C and C++ really operators?

或许你很强,是强硬的,是.的,并且是:oper,用来找回一个结构(C)或等级的成员(C++)。

然而,我怀疑他们是操作者,因为如果是操作者,他们的投入类型是什么? 此外,双方的识别特征是相互依存的,例如,+经营者缺乏这种特征。

If this is correct - in what sense are these still labeled as operator in practice, and what is their formal definition with regard to language theory.

最佳回答

这一提法表明,他们都对C++的操作者进行了改造:

http://www.cplus.com/doc/tutorial/operators/

Is that not authoritative enough?

问题回答

您认为,唯一可以向经营者提出论据的类型是可在语言范围内界定的类型。

我想说,汇编者可以承认的任何类型都可以作为论据,包括内部类型,例如“识别器”。 运营商在其海岸警卫队代表中将有两个论点,足以让你界定属人。

另一种论点是,语言理论可以为你的词汇提供一套定义,但只是其中的一种定义。

For example, an operator may be a man who works a machine. That definition has no relevance to programming theory, but it won t stop me using for keywords in a domain-specific language expressing something to do with machine operating. Similarly, the term "operator" has a wider definition in mathematics than that which is specific to programming theory - and that definition isn t invalidated simply by working with a programming language.

采用另一种方式——如果您不称其为经营者,那么would 页: 1

http://www.ohchr.org。

为了澄清,我的第一个论点是提及使用经营者的辛迪加(电话)。 这些操作者有正确的论据,即身份识别——C++语言无法使用数据类型表示。 C++ 语言does 成员点数与成员相同,但与成员相同。

I assume that is what the question referred to. The right parameter of those operators has a type which cannot be expressed or manipulated normally in the language.

当该辛塔x被设计成超载operator->功能时,情况是不同的。 该功能指向经营者――它只指经营者如何实施。

我认为,你能够超载<代码>->的操作员使用“操作器”关键词,应当是一个空出的。

聪明者往往这样做:

template<class T>
struct myPtr {
    T *operator ->()    { return m_ptr; }

    private:
        T *m_ptr;
};

<代码>:不可上载,但也是按定义操作的。

Hmmm...sizeof 是经营者,其投入类型是什么? 我认为,这个问题对于区分运营商和非经营者而言是有用的。

<><>><>><>>><>>><>>> 系指在节目编排语言中“探测器”是指exactly 语文的作者says 系指该词的含义。 Shades of Lewis Carroll here.

THe C++03标准指两种操作者。

例:

......在经营者申请表达其类别......

如果你不赞同这一术语,你可使用<代码>的校准词。

罗马尼亚广播公司,“我知道”已经以“你”的方式直接说过这一点。 在C术语中:> 。 这就是说的。 页: 1





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签