|
by: Thomas Matthews |
last post by:
Hi,
I understand that a member function can be declared as const
{meaning it doesn't alter the member variables), but can it
be declared as mutable?
I have class that stores its members into a table. The
class has a pointer to the table. The store() method is
constant since the class' members don't change. However,
the table's store method is not constant, which is bringing
|
by: Adam H. Peterson |
last post by:
I'm using a private base class as part of the implementation for one of
my classes. In my implementation, it holds cached data, and I'd like to
be able to call its const member functions from my nonconst members. Is
there a way to get something like "mutable inheritance" to accomplish this?
|
by: pit3k |
last post by:
How can I call non-const member function of a member of a class in one of
it's const qualified member function so that a compiler won't complain?
Here's the code:
bool otl_stream::eof();
class MyClass {
otl_stream m_otl_stream;
public:
|
by: Ingo Nolden |
last post by:
Hi,
I try to use const where ever appropriate.
In a collection class I am counting the iterators that are out. The
counter decrements when an iterator leaves scope or is 'Dispose( )'d
While iterators are around, any deleted item remains as NULL entry in
the inner std::list
This way I had to remove const from most of my member functions. Is is
|
by: christopher diggins |
last post by:
I wrote a dynamic matrix class similar to the one described in TCPL 3rd
Edition. Rather than define two separate iterators for const and non-const
scenarios I decided to be a lazy bastard and only have one and make the data
representation (a std::valarray) mutable instead. My question is, how bad is
that? Am I running the risk of undefined behaviour, or is the worst case
scenario simply const violation?
--
Christopher Diggins...
|
|
by: Pelle Beckman |
last post by:
Hi,
Honestly, what is this 'size_t'?
And while I'm at it - what is a 'mutable' var.?
I've understood it somehow makes a const a non-const,
but what's the point of that?
Short explanations? Links? FAQ?
|
by: Markus.Elfring |
last post by:
The C++ language specification provides the key word "mutable" that is
not available in the C99 standard.
Will it be imported to reduce any incompatibilities?
http://david.tribble.com/text/cdiffs.htm#C99-cpp-keyword
http://www.inf.uni-konstanz.de/~kuehl/c++-faq/const-correctness.html#faq-18.13
Regards,
Markus
|
by: Sambo |
last post by:
By accident I assigned int to a class member 'count' which was initialized to (empty) string and had no error till I tried to use it as string, obviously. Why was there no error on assignment( near the end ).
class Cgroup_info:
group_name = ""
count = "0" #last time checked and processed/retrieved
first = "0"
last = ""
retrieval_type = "" # allways , ask( if more than some limit), none
date_checked = ""
|
by: subramanian100in |
last post by:
I am reading David Musser's "STL Tutorial and Reference Guide" Second
Edition.
In that book, on pages 68-69, definition has been given that "an
iterator can be mutable or constant depending on whether the result of
operator* is a reference or a constant reference."
As per this definition, on page 71 in this book, it is mentioned that
for 'set' and 'multiset', both the iterator and const_iterator types
are constant bidirectional types -...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
|