Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<deque>
- #include<iostream>
- #include<algorithm>
- #include<iterator>
- using namespace std;
- class Liczba {
- public:
- Liczba(int n) : liczba(n) {
- cout<<"normalny/konwertujacy\n";
- }
- operator int() const {
- cout<<"operator int\n";
- return liczba;
- }
- Liczba(const Liczba& l){
- cout<<"kopiujacy";
- liczba=l.liczba;
- }
- Liczba operator + (Liczba& l){
- cout<<"operator +";
- liczba=liczba+l.liczba;
- return *this;
- }
- Liczba operator = (Liczba& l){
- cout<<"operator =";
- liczba=l.liczba;
- return *this;
- }
- int liczba;
- };
- int main() {
- Liczba Lobj1(5);
- Liczba Lobj2 = Lobj1 + 5;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement