Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why won SMC accept class template instances?

class INSTANCES SMC Template
0
Posted

Why won SMC accept class template instances?

0

Because it does not make programming sense. Consider the following: • %class expects a class name after it and not a template. AppTemplate is an actual class while AppTemplate is not a class – it is a template for a class. • The code for AppTemplate is in AppTemplate. By instantiating the class template, you are reusing previously written code. You cannot add code to a class template. • This means that all the FSM-related code must already be in AppTemplate. If the class template knows nothing about SMC-generated classes, then making AppTemplate the context class is a waste of time. There is no application code calling the SMC-generated code. The solution to this problem is based on your owning the AppTemplate code. Create another classAppTemplateFSM, make it a data member in AppTemplate and also the context class for the FSM. All class template instances will then access the SMC-generated classes through AppTemplateFSM and SM

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123