473,770 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Overloading operator []

I have not posted to comp.lang.c++ (or comp.lang.c++.m oderated)
before. In general when I have a C++ question I look for answers in
"The C++ Programming Language, Third Edition" by Stroustrup.
However, I've come upon a question that I can neither answer from
"The Book" or a Google search (so yes, at least I RTFBed). I'm
hoping that someone in this news group might know the answer.

Overloading the [] Operator

Say I want to develop a class that supports the overloaded []
operator and reads and writes the "int" type. I thought that the
way this was done was:

class MyClass
{
//...
// in theory, the RHS operator
const int operator[](const int i ) const;
// in theory, the LHS operator
int& operator[](const int i );
//...
}

Here RHS stands for right-hand-side, or an r-value and LHS stands
for left-hand-side, or an l-value.

MyClass foo;

int i = foo[j]; // RHS reference NOT!
foo[j] = i; // LHS reference

Much to my surprise, the first statement "i = foo[j];" seems to
invoke the overloaded operator I've labeled LHS. I tried this with
Microsoft's Visual C++ 6.0 compiler, I think upgraded with at least
service pack 5 (version 12.00.8804) and the GNU 2.95.2 g++ compiler
for Intel on freeBSD. Both compilers got the same results.

To put things in more concrete form, I've included a complete test
code below:

#include <stdio.h>

class overloaded
{
private:
int *pArray;

public:
overloaded( size_t size )
{
pArray = new int[ size ];
}

~overloaded()
{
delete [] pArray;
}

// in theory, the RHS operator
const int operator[](const int i ) const
{
printf("RHS a[%2d]\n", i );
return pArray[i];
}

// in theory, the LHS operator
int& operator[](const int i )
{
printf("LHS a[%2d]\n", i );
return pArray[i];
}
}; // overloaded
int
main()
{
const int len = 4;
overloaded a(len);
int b[len];

int i;

printf("initial izing array...\n");
for (i = 0; i < len; i++) {
a[i] = i + 1;
}

printf("reading values from array in an 'if' statement...\n" );
for (i = 0; i < len; i++) {
if (a[i] != i+1) {
printf("bad value");
break;
}
}

printf("reading values from an array in an assignment...\n ");
for (i = 0; i < len; i++) {
b[i] = a[i];
}

printf("express ion...\n");
int j = a[1] + a[2];
return 0;
}

When I compile and execute this code I get

initializing array...
LHS a[ 0]
LHS a[ 1]
LHS a[ 2]
LHS a[ 3]
reading values from array in an 'if' statement...
LHS a[ 0]
LHS a[ 1]
LHS a[ 2]
LHS a[ 3]
reading values from an array in an assignment...
LHS a[ 0]
LHS a[ 1]
LHS a[ 2]
LHS a[ 3]
expression...
LHS a[ 1]
LHS a[ 2]

I expected that the "initialization " would reference the LHS form of
the overloaded function. However, much to my surprise, the 'if'
statement and the value reads also referenced the LHS form of the
overloaded operator. I'm surprised at this, since as far as I can
tell, this way I've implemented the overloaded [] operators is
pretty much "text book" approach.

Is there a way to implement this class so that the RHS [] will be
called when it seems to be an r-value? That is

if (a[i] != i+1)
b[i] = a[i];
int j = a[1] + a[2];

In this example the difference is not critical, since the code gets
the expected results. However, proper invokation of the RHS and LHS
operators is important in the case of reference counted objects,
which is the appliction that originally motivated this question.

I'm working on a third version of a reference counted String class,
which can be found here:
http://www.bearcave.com/software/string/index.html. This class
suffers from a bug caused by the behavior of the [] operator
described above. In particular, it is making too many copies.

I have noted Stroustrup's solution using the Cref class (from 11.12
of "The Book"). However, in his code it appears that you might as
well omit the RHS version of the [] operator.

I'd be grateful for a version of the test code above that invokes
the RHS operator for what appear to be r-value references. Could
you please copy any postings on this to "iank at bearcave dot com".
Thank you for your help,

Ian
iank at bearcave dot com

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.m oderated. First time posters: Do this! ]
Jul 19 '05 #1
30 10449

"(null)" <ia**@idiom.com > wrote in message news:1058054598 .920916@smirk.. .
I have not posted to comp.lang.c++ (or comp.lang.c++.m oderated)
before. In general when I have a C++ question I look for answers in
"The C++ Programming Language, Third Edition" by Stroustrup.
However, I've come upon a question that I can neither answer from
"The Book" or a Google search (so yes, at least I RTFBed). I'm
hoping that someone in this news group might know the answer.

Overloading the [] Operator

Say I want to develop a class that supports the overloaded []
operator and reads and writes the "int" type. I thought that the
way this was done was:

class MyClass
{
//...
// in theory, the RHS operator
const int operator[](const int i ) const;
// in theory, the LHS operator
int& operator[](const int i );
//...
I'd prefer

int operator[](int i ) const;
int& operator[](int i );

for an int type the other const's are unecessary.

Your comments about RHS operator and LHS operator are incorrect however. See
below.
}

Here RHS stands for right-hand-side, or an r-value and LHS stands
for left-hand-side, or an l-value.

MyClass foo;

int i = foo[j]; // RHS reference NOT!
foo[j] = i; // LHS reference

Much to my surprise, the first statement "i = foo[j];" seems to
invoke the overloaded operator I've labeled LHS. I tried this with
Microsoft's Visual C++ 6.0 compiler, I think upgraded with at least
service pack 5 (version 12.00.8804) and the GNU 2.95.2 g++ compiler
for Intel on freeBSD. Both compilers got the same results.

[snip]

I expected that the "initialization " would reference the LHS form of
the overloaded function. However, much to my surprise, the 'if'
statement and the value reads also referenced the LHS form of the
overloaded operator. I'm surprised at this, since as far as I can
tell, this way I've implemented the overloaded [] operators is
pretty much "text book" approach.

Is there a way to implement this class so that the RHS [] will be
called when it seems to be an r-value? That is

if (a[i] != i+1)
b[i] = a[i];
int j = a[1] + a[2];

It would be nice if you could do what you want to do but you can't.

For clarity lets denote operator[] by F, and operator= by G, then
essentially what you are asking for is the compiler to distinguish between
calls to F in

G(...,F(i))

from

G(F(i), ...)

But the compiler cannot do this for any normal function so there is no
reason to expect it to work for operator[] and operator=.
In this example the difference is not critical, since the code gets
the expected results. However, proper invokation of the RHS and LHS
operators is important in the case of reference counted objects,
which is the appliction that originally motivated this question.

I'm working on a third version of a reference counted String class,
which can be found here:
http://www.bearcave.com/software/string/index.html. This class
suffers from a bug caused by the behavior of the [] operator
described above. In particular, it is making too many copies.
Right, which is why you should avoid operator[] on reference counted string
classes. It is impossible to implement in an efficient manner. Implementing
operator[] on a non-const reference counted string class means a compromise,
either you have to take a copy of the string immediately even though
operator[] might only be being used to read from the string, or you have to
write a proxy class (e.g. Cref in Stroustrup).

I have noted Stroustrup's solution using the Cref class (from 11.12
of "The Book"). However, in his code it appears that you might as
well omit the RHS version of the [] operator.


Well there is no RHS version of [] you have been misinformed. If you omitted
the const version of operator[] from Stroustrup's code then the following
would not compile

const String x = "abc";
cout << x[0];

This is the true meaning of the const version of operator[], it allows you
to access const objects. Same as any other const method.

john
Jul 19 '05 #2
>
I'm working on a third version of a reference counted String class,
which can be found here:
http://www.bearcave.com/software/string/index.html. This class
suffers from a bug caused by the behavior of the [] operator
described above. In particular, it is making too many copies.


BTW, from the above site

"When an STL string object is assigned to another string object, a copy is
made. In contrast, the String container copies a reference and increments a
reference count."

This is not strictly correct, the standard leaves it up to the
implementation whether to use reference counting or not. My version of the
STL (dinkumware) does use reference counting.

john
Jul 19 '05 #3


"(null)" schrieb:
class MyClass
{
//...
// in theory, the RHS operator
const int operator[](const int i ) const;
// in theory, the LHS operator
int& operator[](const int i );
//...
}
All these members are in the private section of the class.
I assume you missed a "public:" somewhere.



Here RHS stands for right-hand-side, or an r-value and LHS stands
for left-hand-side, or an l-value.

MyClass foo;

int i = foo[j]; // RHS reference NOT!
foo[j] = i; // LHS reference

Much to my surprise, the first statement "i = foo[j];" seems to
invoke the overloaded operator I've labeled LHS.


No surprise at all.
Your foo-object is non-const, so the compiler invokes the non-const
overloaded operator[].
Why should it invoke the const version?

Things are totally different when foo is defined as const:

const MyClass foo;

Then the compiler will, of course, invoke the const-version of operator[].
Note that this overload resolution has nothing to do with the fact if you
use your overloaded operator[] at the call site as LHS or RHS.
regards,

Thomas

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.m oderated. First time posters: Do this! ]
Jul 19 '05 #4
"John Harrison" <jo************ *@hotmail.com> wrote in message news:<be******* *****@ID-196037.news.uni-berlin.de>...
Right, which is why you should avoid operator[] on reference counted string
classes. It is impossible to implement in an efficient manner. Implementing
operator[] on a non-const reference counted string class means a compromise,
either you have to take a copy of the string immediately even though
operator[] might only be being used to read from the string, or you have to
write a proxy class (e.g. Cref in Stroustrup).

You seem to be making an assumption here. If I read your statement
correctly, you say that it is impossible to implement the non-const
index operator on a reference counted String in an efficient manner.
You then state that in order to do this, you need to write a proxy
class. Therefore, you are making the assumption that the proxy class
makes the class non-efficient.

This *may* not be true. It depends on if the compiler can optimize
away much, if not all, of the use of the proxy class.

Even if this one function makes the refernce counted String class
slightly less efficient to use, the other gains from the
refernce-counted String class *may* outweigh this small expense- it
proveably did on our system. The only way to tell on your system is
to try it.

We have a home grown reference counted String class, and it uses a
proxy class to implement the return value of the non-const index
operator. The class is extremely efficient, and fast. Our source
code base which uses this class has about 400 engineering-man-years of
development in it, consisting of hundreds of thousands of lines of
code. When we released our reference counted String class in place of
the old version, we saw at least a 10% improvement in our average CPU
consumption. Sections of our application which used Strings heavily
saw much more significant gains. We are certain that we would see
even more gains if we did not have legacy code that depended on
certain behaviors of the old String class, which required some slight
inefficiencies be purposely introduced into the new String class.

The bottom line- lots of reference-counted string bashing goes on in
this newsgroup. Most of this bashing is by people who probably never
wrote such a class themselves. We took the time to write one, and
thoroughly test and review it for completeness, correctness, and
safety. This class has had nothing but positive impact on *our*
system. Your mileage may vary.

joshua lehrer
factset research systems
NYSE:FDS

p.s. to order your very own "RefStrings Rule!" bumper-sticker, send a
self addressed stamped envelope to...
Jul 19 '05 #5

"Joshua Lehrer" <us********@leh rerfamily.com> wrote in message
news:31******** *************** ***@posting.goo gle.com...
"John Harrison" <jo************ *@hotmail.com> wrote in message news:<be******* *****@ID-196037.news.uni-berlin.de>...
Right, which is why you should avoid operator[] on reference counted string classes. It is impossible to implement in an efficient manner. Implementing operator[] on a non-const reference counted string class means a compromise, either you have to take a copy of the string immediately even though
operator[] might only be being used to read from the string, or you have to write a proxy class (e.g. Cref in Stroustrup).

You seem to be making an assumption here. If I read your statement
correctly, you say that it is impossible to implement the non-const
index operator on a reference counted String in an efficient manner.
You then state that in order to do this, you need to write a proxy
class. Therefore, you are making the assumption that the proxy class
makes the class non-efficient.


OK, maybe I didn't choose the best words. Substitute 'as simply as you
think' for 'efficiently'.

This *may* not be true. It depends on if the compiler can optimize
away much, if not all, of the use of the proxy class.

Even if this one function makes the refernce counted String class
slightly less efficient to use, the other gains from the
refernce-counted String class *may* outweigh this small expense- it
proveably did on our system. The only way to tell on your system is
to try it.
Couldn't disagree with that.

We have a home grown reference counted String class, and it uses a
proxy class to implement the return value of the non-const index
operator. The class is extremely efficient, and fast. Our source
code base which uses this class has about 400 engineering-man-years of
development in it, consisting of hundreds of thousands of lines of
code. When we released our reference counted String class in place of
the old version, we saw at least a 10% improvement in our average CPU
consumption. Sections of our application which used Strings heavily
saw much more significant gains. We are certain that we would see
even more gains if we did not have legacy code that depended on
certain behaviors of the old String class, which required some slight
inefficiencies be purposely introduced into the new String class.

The bottom line- lots of reference-counted string bashing goes on in
this newsgroup.
Not by me (at least not intentionally). Hell, I even believe that copy on
write is a generally useful technique.
Most of this bashing is by people who probably never
wrote such a class themselves. We took the time to write one, and
thoroughly test and review it for completeness, correctness, and
safety. This class has had nothing but positive impact on *our*
system. Your mileage may vary.

joshua lehrer
factset research systems
NYSE:FDS

p.s. to order your very own "RefStrings Rule!" bumper-sticker, send a
self addressed stamped envelope to...


Where? Where can I get one!?

john
Jul 19 '05 #6
ia**@idiom.com ((null)) writes:
I have not posted to comp.lang.c++ (or comp.lang.c++.m oderated)
before. In general when I have a C++ question I look for answers in
"The C++ Programming Language, Third Edition" by Stroustrup.
However, I've come upon a question that I can neither answer from
"The Book" or a Google search (so yes, at least I RTFBed).
Well it is a big book sometimes people miss things, or don't add up
seperate things in the intended way. 10.2.6 explains constant
member functions.

I'm hoping that someone in this news group might know the answer.

Overloading the [] Operator

Say I want to develop a class that supports the overloaded []
operator and reads and writes the "int" type. I thought that the
way this was done was:

class MyClass
{
//...
// in theory, the RHS operator
const int operator[](const int i ) const;
// in theory, the LHS operator
int& operator[](const int i );
'const' is a propertery of an object, not of an operator=. If the
instance of MyClass is const, the first will be called, and if the
instance of MyClass is not const, the second will be called. This
is true regardless of which side of operator= the use of
operator[] occurs.

(Note: in order to have behavior more like that of builtin[], the
first operator[] should return 'int const&' )
//...
}

Here RHS stands for right-hand-side, or an r-value and LHS stands
for left-hand-side, or an l-value.

MyClass foo;

int i = foo[j]; // RHS reference NOT!
foo[j] = i; // LHS reference

Much to my surprise, the first statement "i = foo[j];" seems to
invoke the overloaded operator I've labeled LHS.

[snip]

This is correct behavior; foo is not const, so
int& MyClass::operat or[](int) is called, and not
int const MyClass::operat or[](int) const . It is constness,
and not side of operator=, that matters. Had you written:

MyClass const foo;

int i = foo[j];
foo[j]= i;

both calls would have called
int const MyClass::operat or[](int) const .

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.m oderated. First time posters: Do this! ]
Jul 19 '05 #7
us********@lehr erfamily.com (Joshua Lehrer) wrote in message
news:<31******* *************** ****@posting.go ogle.com>...

[...]
The bottom line- lots of reference-counted string bashing goes on in
this newsgroup. Most of this bashing is by people who probably never
wrote such a class themselves. We took the time to write one, and
thoroughly test and review it for completeness, correctness, and
safety. This class has had nothing but positive impact on *our*
system. Your mileage may vary.


I suspect that most of the bashing is an accidental extension of
reference-count bashing with regards to an implementation of
std::string. The standard does NOT allow the use of a proxy -- the
non-const version of operator[] must return a real reference. This
requires special handling even in a single threaded version with
reference counting, and is almost impossible to get right efficiently in
a multi-threaded version -- you end up needing a lock for practically
every single access.

For the rest, in the past, I too have found reference counting to be a
win. In my own code -- I can't speak for others. (Like you, my string
class used a proxy as the return value for the non-const operator[].)

--
James Kanze GABI Software mailto:ka***@ga bi-soft.fr
Conseils en informatique orientée objet/ http://www.gabi-soft.fr
Beratung in objektorientier ter Datenverarbeitu ng
11 rue de Rambouillet, 78460 Chevreuse, France, +33 (0)1 30 23 45 16
Jul 19 '05 #8
(null) <ia**@idiom.com > wrote:
I have not posted to comp.lang.c++ (or comp.lang.c++.m oderated)
before. In general when I have a C++ question I look for answers in
"The C++ Programming Language, Third Edition" by Stroustrup.
However, I've come upon a question that I can neither answer from
"The Book" or a Google search (so yes, at least I RTFBed). I'm
hoping that someone in this news group might know the answer.

Overloading the [] Operator

Say I want to develop a class that supports the overloaded []
operator and reads and writes the "int" type. I thought that the
way this was done was:

class MyClass
{
//...
// in theory, the RHS operator
const int operator[](const int i ) const;
// in theory, the LHS operator
int& operator[](const int i );
//...
}

Here RHS stands for right-hand-side, or an r-value and LHS stands
for left-hand-side, or an l-value.

MyClass foo;

int i = foo[j]; // RHS reference NOT!
foo[j] = i; // LHS reference

Much to my surprise, the first statement "i = foo[j];" seems to
invoke the overloaded operator I've labeled LHS. I tried this with
Microsoft's Visual C++ 6.0 compiler, I think upgraded with at least
service pack 5 (version 12.00.8804) and the GNU 2.95.2 g++ compiler
for Intel on freeBSD. Both compilers got the same results.

To put things in more concrete form, I've included a complete test
code below:

#include <stdio.h>

class overloaded
{
private:
int *pArray; const int rhs_bracket(i) const
{
// perform = overloaded_arra y[i]
printf("RHS a[%2d]\n",i);
return pArray[i[;
}
void lhs_bracket(int i,int x)
{
// perform overloaded_arra y[i] = x;
printf("LHS a[%2d] = %d\n",i,x);
pArray[i] = x;
}
public: class proxy
{
overloaed *over;
int index;
proxy(overloade d *a,int b):over(a),inde x(b){}
public:
friend class overloaded;
operator int() { return over->rhs_bracket(i) ;}
proxy & operator = (int x)
{
over->lhs_bracket(i, x);
return *this;
}
};
friend class proxy;
proxy operator [] (int i) {return proxy(this,i);}
overloaded( size_t size )
{
pArray = new int[ size ];
}

~overloaded()
{
delete [] pArray;
}
#if 0 // in theory, the RHS operator
const int operator[](const int i ) const
{
printf("RHS a[%2d]\n", i );
return pArray[i];
}

// in theory, the LHS operator
int& operator[](const int i )
{
printf("LHS a[%2d]\n", i );
return pArray[i];
} #endif
}; // overloaded
...

This will result in different behavior depending on whether operator
[] is used to read or write data to/from an overloaded.

Note i used mutual friendship so only overloaded::ope rator [] will
create an overloaded::pro xy objwct. and private functions to do the
different items on the lhs and rhs of an equal sign. Making them private
and proxy a friend means that only proxy is going to access these
implimentation detail functions. This approach can also be used with
operator *() and operator ->() to preform different operations when
reading and writing.

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.m oderated. First time posters: Do this! ]
Jul 19 '05 #9


James Kanze schrieb:

Normally, this should not be a problem. There are exceptions,
however, when you need to do something different if the target is
actually modified. In such cases, you typically need to use some sort
of Proxy, e.g.:

class MyClass
{
public:
class Proxy
{
friend class MyClass ;
public:
operator int() const
{
return myOwner.get( myIndex ) ;
}
Proxy const& operator=( int other ) const
{
myOwner.put( myIndex, other ) ;
return *this ;
}
private:
Proxy( MyClass& owner, int index )
: myOwner( owner )
, myIndex( index )
{
}

MyClass& myOwner ;
int myIndex ;
} ;

void put( int index, int newValue ) ;
int get( int index ) const ;

Proxy operator[]( int index )
{
return Proxy( *this, index ) ;
}
int operator[]( int index ) const
{
return get( index ) ;
}
} ;

All of the actual logic is then in get and put.


What advantage does one gain by writing a proxy class, instead of simply
returning an int&?

That is, why not simply write the following overloaded operator[]?

int& operator[](int index)
regards,

Thomas
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.m oderated. First time posters: Do this! ]
Jul 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
5247
by: | last post by:
Hi all, I've been using C++ for quite a while now and I've come to the point where I need to overload new and delete inorder to track memory and probably some profiling stuff too. I know that discussions of new and delete is a pretty damn involved process but I'll try to stick to the main information I'm looking for currently. I've searched around for about the last too weeks and have read up on new and overloading it to some extent but...
16
3096
by: gorda | last post by:
Hello, I am playing around with operator overloading and inheritence, specifically overloading the + operator in the base class and its derived class. The structure is simple: the base class has two int memebers "dataA", "dataB". The derived class has an additional int member "dataC". I am simply trying to overload the + operator so that 'adding' two objects will sum up the corresponding int members.
2
2067
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 overloading of operator<<. In the .cc of the respective class or in a file where I am overloading operator<< for all classes? Cheers,
5
2490
by: luca regini | last post by:
I have this code class M { ..... T operator()( size_t x, size_t y ) const { ... Operator overloading A ....} T& operator()( size_t x, size_t y )
2
2260
by: brzozo2 | last post by:
Hello, this program might look abit long, but it's pretty simple and easy to follow. What it does is read from a file, outputs the contents to screen, and then writes them to a different file. It uses map<and heavy overloading. The problem is, the output file differs from input, and for the love of me I can't figure out why ;p #include <iostream> #include <fstream> #include <sstream>
5
3629
by: Jerry Fleming | last post by:
As I am newbie to C++, I am confused by the overloading issues. Everyone says that the four operators can only be overloaded with class member functions instead of global (friend) functions: (), , ->, =. I wonder why there is such a restriction. Some tutorials say that 'new' and 'delete' can only be overloaded with static member functions, others say that all overloading function should be non-static. Then what is the fact, and why? ...
3
3282
by: y-man | last post by:
Hi, I am trying to get an overloaded operator to work inside the class it works on. The situation is something like this: main.cc: #include "object.hh" #include "somefile.hh" object obj, obj2 ;
9
3513
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 allowing the assignment operator (=) to be overloaded. One particular use for this would be to implement "lazy evaluation". For example it would allow us to get rid of all the temporary arrays produced by NumPy. For example, consider the...
2
4442
by: Colonel | last post by:
It seems that the problems have something to do with the overloading of istream operator ">>", but I just can't find the exact problem. // the declaration friend std::istream & operator>(std::istream & in, const Complex & a); // the methods correspond to the friend std::istream & operator>(std::istream & in, const Complex & a) { std::cout << "real: ";
8
2976
by: Wayne Shu | last post by:
Hi everyone, I am reading B.S. 's TC++PL (special edition). When I read chapter 11 Operator Overloading, I have two questions. 1. In subsection 11.2.2 paragraph 1, B.S. wrote "In particular, operator =, operator, operator(), and operator-must be nonstatic member function; this ensures that their first operands will be lvalues". I know that these operators must be nonstatic member functions, but why this ensure their first operands will...
0
9618
marktang
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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,...
0
10260
Oralloy
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
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...
1
10038
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,...
0
9906
tracyyun
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...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
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
3
2850
bsmnconsultancy
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...

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.