Jul 15, 2005 #1 1rstSol Programmer Mar 8, 2005 6 0 0 FR Is it possible to use overload while functions’ arguments are ‘user object’ type ?
Jul 16, 2005 #2 aschi666 Programmer Jul 11, 2005 66 0 0 DE don't know why you shouldn't be able to... what your goin to do anyway? __________________________________________ a programmer is a tool that converts coffee into code... aschi666, sthcomputing.de Upvote 0 Downvote
don't know why you shouldn't be able to... what your goin to do anyway? __________________________________________ a programmer is a tool that converts coffee into code... aschi666, sthcomputing.de
Jul 16, 2005 Thread starter #3 1rstSol Programmer Mar 8, 2005 6 0 0 FR I have to write a visitor design-pattern in which function selection is based on arguments’ type. ------------- | Visitor | |-----------| |Visit(Elt) | |Visit(EltA)| |Visit(EltB)| ------------- |____________________ | | ---------------- ---------------- | VistorCountA | | VistorCountB | | ------------ | |--------------- | Visit(Elt) | | Visit(Elt) | | Visit(EltA) | | Visit(EltA) | | Visit(EltB) | | Visit(EltB) | ---------------- ---------------- On heritage tree: --------------------- | Elt | --------------------- | Accept(Visitor v) | --------------------- |___________________________ | | --------------------- --------------------- | EltA | | EltB | |-------------------| |-------------------| | Accept(Visitor v) | | Accept(Visitor v) | --------------------- --------------------- In this sample, classes Elt, EltA, and EltB are user object’s type. And I have to write three functions named ‘Visit()’. Upvote 0 Downvote
I have to write a visitor design-pattern in which function selection is based on arguments’ type. ------------- | Visitor | |-----------| |Visit(Elt) | |Visit(EltA)| |Visit(EltB)| ------------- |____________________ | | ---------------- ---------------- | VistorCountA | | VistorCountB | | ------------ | |--------------- | Visit(Elt) | | Visit(Elt) | | Visit(EltA) | | Visit(EltA) | | Visit(EltB) | | Visit(EltB) | ---------------- ---------------- On heritage tree: --------------------- | Elt | --------------------- | Accept(Visitor v) | --------------------- |___________________________ | | --------------------- --------------------- | EltA | | EltB | |-------------------| |-------------------| | Accept(Visitor v) | | Accept(Visitor v) | --------------------- --------------------- In this sample, classes Elt, EltA, and EltB are user object’s type. And I have to write three functions named ‘Visit()’.