|
by: Trevor Lango |
last post by:
I want to be able to cast away the constness of a private member variable in
a member function of a class.
I have the private data member declared as follows:
const double x;
I have an overloaded assignment operator implemented as follows:
Point &Point::operator=( const Point *somePoint )
|
by: Marc |
last post by:
T x;
T foo(T, T);
bind1st(ptr_fun(foo), x)
creates a function object that takes an argument of type T const&. This
does not work if T is already a reference type like int const&. So my
first problem is with the &. My second problem is with the const. Why
should bind1st change the constness of the second argument of the
function ?
|
by: Gonçalo Rodrigues |
last post by:
Hi all,
I have a class, call it Object of heap-allocated objects. They are
managed via a smart pointer class Ref (actually a template class but
that does not matter for the problem). Object instances are created
via a factory method that returns a Ref and all constructors are
protected.
My "problem" is the following. The Ref class is...
|
by: Srini |
last post by:
Hello all,
I was just wondering about this. A const member function guarantees
constness of the object within the function body. But there's no way
for a member function to guarantee the constness of static members. Is
there a way to do that? Also, is there a way for a static member
function to guarantee constness of static members?
TIA...
|
by: Querejeto |
last post by:
Hello:
Is it possible to detect programmatically the constness of a member
function when it is called?
That is, I would like to see a generic implementation (i.e. it does not
depend on the class Base) of the createInstance function below that
produces the output:
Output:
|
|
by: MaxMax |
last post by:
I have a problem of constness.
struct MyS
{
int x;
}
void MyFunc(MyS* pA)
{
}
|
by: PengYu.UT |
last post by:
In the following program, I want an iterator contain pointer pointing
to constant object not const pointer. If it is possible would you
please let me know how to do it?
#include <boost/shared_ptr.hpp>
#include <vector>
#include <iterator>
#include <iostream>
class trial {
|
by: Laurent Deniau |
last post by:
I am looking for the "cleanest" way to cast away the constness of a
pointee in C89, something like const_cast<T*>() in C++. Actually, I am
using:
#define CONST_CAST(typename,value) \
(((union { const typename cv; typename v; }*)&(value))->v)
which requires value to be an lvalue, but avoid compiler warning (gcc)
comparing to the brute...
|
by: Javier |
last post by:
Hello,
I have some cuestions about constness with standard containers and
pointers.
Supose I have a list of pointers to some class B:
std::list< B * list;
I have readed that constness in std::list is the same that it is in C
arrays (const std::list makes const both the list and its content):
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
|
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...
|
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
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...
|
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...
|