Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » method passed as parameter in function
method passed as parameter in function [message #57587] Sun, 03 October 2021 15:04 Go to previous message
BetoValle is currently offline  BetoValle
Messages: 203
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
Hi,

These methods below within the class do not allow it to be
compiled this way! is it possible something analogous
so that the fx_ method inside the class
compile on u++? If positive how would it be?

Thanks!


class ab {
public:
	String fx1( Value v1){
		
	 return "fx1";	
	}
	String fx2( Value v2){
		
	 return "fx2";	
	}
	String fx3( Value v3){
		
	 return "fx3";	
	}	
        String fx_( Value v , String (ab::*func)(Value) ){

          return func(v);          
  
        }

};

CONSOLE_APP_MAIN
{
   
   Value v=1;
   ab f
   String x= f.fx_( v, ab::&fx1);
   Cout() << x << EOL;
}


 
Read Message
Read Message
Read Message
Previous Topic: The next step: 32bit wchar
Next Topic: Global Mouse
Goto Forum:
  


Current Time: Mon Jun 10 00:30:17 CEST 2024

Total time taken to generate the page: 0.01805 seconds