Sponsored Content
Full Discussion: C++ Optr Overloading
Top Forums Programming C++ Optr Overloading Post 302290364 by Nagapandi on Monday 23rd of February 2009 04:25:52 AM
Old 02-23-2009
C++ Optr Overloading

Hi All,

In C++ one operator can be overloaded, but it can't be overloaded by it's own derieved class

Please let me know operator.

Thanks,
NagaSmilie
 

5 More Discussions You Might Find Interesting

1. AIX

xlC compilation error when dealing with operator overloading

Hi, I have a piece of C++ code that can be compiled using g++, but reports an error when compiled with xlC: xlC -DHAVE_CONFIG_H -I../SRC -I../include -DNoChange -DSPRNG_MPI -q64 -DLONG64=long -I/usr/lpp/ppe.poe/include -DLONG64=long -c -o libsprng_a-bignum.o bignum.cpp "bignum.cpp",... (1 Reply)
Discussion started by: luop0812
1 Replies

2. Programming

Delete operator overloading with multiple arguments.

Hi, I have an requirement to overload the delete operator in C++, but it should also accept the sizeof() the object that is to be deleted. Actually I am trying to built a custom memory allocator and deallocator like a pool, which makes me to overload the delete operator. Small example of the... (1 Reply)
Discussion started by: kapilkumawat
1 Replies

3. Programming

c++ assignment operator overloading

Hello everyone! Suppose that I have something like this A a; a.mem=new int; A b = a; where class A { public: int * mem; A() : mem(NULL) { } ~A() { if (mem!=NULL) delete mem; (1 Reply)
Discussion started by: bashuser2
1 Replies

4. UNIX for Dummies Questions & Answers

mysqld overloading cpu of VPS

Hi bros I have a VPS 512mb (Burst 2GB) with Kloxo installed and hosting few sites on it with not much traffic I am facing high cpu load for the last few days and seems mysqld is overloading the cpu Any suggestion will be appreciated Regards Rizwan Top output is as under top -... (2 Replies)
Discussion started by: rizwan65
2 Replies

5. Programming

C++ operator overloading error

hi, I defined my own String class and overloaded the output operator with friend ostream& operator<<(ostream& os, const myString& str); //overloads the << operator so it can be used to output values of type myString which works fine. Until I try to execute the following statement: // +... (6 Replies)
Discussion started by: milhan
6 Replies
Imager::Matrix2d(3pm)					User Contributed Perl Documentation				     Imager::Matrix2d(3pm)

NAME
Imager::Matrix2d - simple wrapper for matrix construction SYNOPSIS
use Imager::Matrix2d; $m1 = Imager::Matrix2d->identity; $m2 = Imager::Matrix2d->rotate(radians=>$angle, x=>$cx, y=>$cy); $m3 = Imager::Matrix2d->translate(x=>$dx, y=>$dy); $m4 = Imager::Matrix2d->shear(x=>$sx, y=>$sy); $m5 = Imager::Matrix2d->reflect(axis=>$axis); $m6 = Imager::Matrix2d->scale(x=>$xratio, y=>$yratio); $m8 = Imager::Matric2d->matrix($v11, $v12, $v13, $v21, $v22, $v23, $v31, $v32, $v33); $m6 = $m1 * $m2; $m7 = $m1 + $m2; use Imager::Matrix2d qw(:handy); # various m2d_* functions imported # where m2d_(.*) calls Imager::Matrix2d->$1() DESCRIPTION
This class provides a simple wrapper around a reference to an array of 9 co-efficients, treated as a matrix: [ 0, 1, 2, 3, 4, 5, 6, 7, 8 ] Most of the methods in this class are constructors. The others are overloaded operators. Note that since Imager represents images with y increasing from top to bottom, rotation angles are clockwise, rather than counter- clockwise. identity() Returns the identity matrix. rotate(radians=>$angle) rotate(degrees=>$angle) Creates a matrix that rotates around the origin, or around the point (x,y) if the 'x' and 'y' parameters are provided. translate(x=>$dx, y=>$dy) translate(x=>$dx) translate(y=>$dy) Translates by the specify amounts. shear(x=>$sx, y=>$sy) shear(x=>$sx) shear(y=>$sy) Shear by the given amounts. reflect(axis=>$axis) Reflect around the given axis, either 'x' or 'y'. reflect(radians=>$angle) reflect(degrees=>$angle) Reflect around a line drawn at the given angle from the origin. scale(x=>$xratio, y=>$yratio) Scales at the given ratios. You can also specify a center for the scaling with the "cx" and "cy" parameters. matrix($v11, $v12, $v13, $v21, $v22, $v23, $v31, $v32, $v33) Create a matrix with custom co-efficients. _mult() Implements the overloaded '*' operator. Internal use. Currently both the left and right-hand sides of the operator must be an Imager::Matrix2d. _add() Implements the overloaded binary '+' operator. Currently both the left and right sides of the operator must be Imager::Matrix2d objects. _string() Implements the overloaded stringification operator. This returns a string containing 3 lines of text with no terminating newline. I tried to make it fairly nicely formatted. You might disagree :) _eq Implement the overloaded equality operator. Provided for older perls that don't handle magic auto generation of eq from "". The following functions are shortcuts to the various constructors. These are not methods. You can import these methods with: use Imager::Matrix2d ':handy'; m2d_identity m2d_rotate() m2d_translate() m2d_shear() m2d_reflect() m2d_scale() AUTHOR
Tony Cook <tony@develop-help.com> BUGS
Needs a way to invert a matrix. SEE ALSO
Imager(3), Imager::Font(3) http://imager.perl.org/ perl v5.14.2 2011-11-25 Imager::Matrix2d(3pm)
All times are GMT -4. The time now is 02:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy