Re: refptrs and dynamic casting



On Wed, 2005-11-30 at 13:40 -0500, Paul Davis wrote:
> Suppose you do this:
> 
> 	RefPtr<Action> act = ui_manager.get_action("<Actions>/Foo/Bar");
>        
> but you also know that the action is really a toggle action, and you
> want to change its current status. so you want:
> 
>         RefPtr<Action> toggle;
>         toggle->set_active (yn);
> 
> How to get from the refptr to Action to a refptr to ToggleAction.
> normally one would use a dynamic cast, but RefPtr's are not pointers ...

one would read the docs more carefully, is what one would do.

sorry.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]