wxRect doesnot have a copy constructor

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Extremeware
In need of some credit
In need of some credit
Posts: 2
Joined: Mon May 06, 2019 8:48 am

wxRect doesnot have a copy constructor

Post by Extremeware » Thu Nov 07, 2019 1:56 pm

Well, is it ok?

User avatar
doublemax
Moderator
Moderator
Posts: 14171
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxRect doesnot have a copy constructor

Post by doublemax » Thu Nov 07, 2019 3:03 pm

Why should it have? wxRect only consists of 4 integers, the compiler knows everything he needs to know to copy this structure.
Use the source, Luke!

alys666
Super wx Problem Solver
Super wx Problem Solver
Posts: 267
Joined: Tue Oct 18, 2016 2:31 pm

Re: wxRect doesnot have a copy constructor

Post by alys666 » Thu Nov 07, 2019 9:22 pm

ubuntu 16.04, wxWidgets 3.0.4

Extremeware
In need of some credit
In need of some credit
Posts: 2
Joined: Mon May 06, 2019 8:48 am

Re: wxRect doesnot have a copy constructor

Post by Extremeware » Tue Nov 12, 2019 5:52 am

Very useful information. for someone does not think that not providing copy constructor will not confuse programmer.
the information is for people who program compiler, Isn't it?

alys666
Super wx Problem Solver
Super wx Problem Solver
Posts: 267
Joined: Tue Oct 18, 2016 2:31 pm

Re: wxRect doesnot have a copy constructor

Post by alys666 » Tue Nov 12, 2019 4:00 pm

if you have not provided a copy constructor then you assume that default copy ctor works well. and byte-to-byte copy is what you need.
else you must write explicit trivial copy ctor, and invoke memcpy(...), or field to field copy, inside it.
is it good for programmer?
ubuntu 16.04, wxWidgets 3.0.4

Post Reply