473,320 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Overloading operator -> for const member functions

Problem:
The operator -> is overloaded thus
Class * operator-> () { return this; }

but this causes a problem for const member functions . The purpose of overloading is that both . and -> can be used .

Is there a way out for const member function ?
Nov 29 '06 #1
0 1086

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Bo Sun | last post by:
hi: in the following code: class plus{ int data_item; public:
2
by: pmatos | last post by:
Hi all, I'm overloading operator<< for a lot of classes. The question is about style. I define in each class header the prototype of the overloading as a friend. Now, where should I define the...
13
by: Jon Cosby | last post by:
VB .Net does support operator overloading, doesn't it? It seems like this should overload binary addition, but VB doesn't recognize "Operator" Public Shared Operator +(ByVal c1 as cnum, ByVal c2...
6
by: TuxC0d3 | last post by:
Hi! I'm diving into the some more ++ specific aspects of c++ (and finally accepting that c++ is more than "a plus added to c" :), so that means using namespaces, templates, std::strings, lists,...
2
by: vivekian | last post by:
Have a pointer to an object of class type task task * A ; Now this object takes operator overloading like A<<2 ; which assigns the number 2 to one of the members of the object A.
3
by: Lighter | last post by:
The C++ Standard Doesn't Permit Overloading new and delete? In the 13.5 of The C++ standard (ISO/IEC 14882, 1998), I cannot find the specification on overloading the operators new and delete;...
9
by: sturlamolden | last post by:
Python allows the binding behaviour to be defined for descriptors, using the __set__ and __get__ methods. I think it would be a major advantage if this could be generalized to any object, by...
2
by: Bharath | last post by:
Hello All, Can you please let me know if we can do pointer arthrmetic using operator overloading? If not, can you please explain why it's not supported by compiler? I tried below e.g. which was...
3
by: kvnsmnsn | last post by:
I've been asked to overload the insertion operator. What exactly is the insertion operator in C++, and how would one overload it? I think that in C I could overload the "+" operator like so: ...
2
by: rn5a | last post by:
I use VB.NET to create ASP.NET apps. If I am not wrong, there is something called method overloading in VB.NET (like in C#) which is one of the features in OOP (polymorphism) but does VB.NET also...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.