Feb 4, 2012 at 8:10pm UTC
hi there
i'm writing some codes (oop code) in linux (ubuntu) in witch class ellastic is defined as below in prelim header :
template <int dim>
class elastic
{
public:
elastic(const Triangulation<dim> *triang);
~elastic() ;
void one_step () ;
private:
. ...
and in another header i have
#include "prelim.h"
template <int dim>
elastic<dim>::elastic(const Triangulation<dim> *triang): dof_handler (triangulation), fe (FE_Q<dim>(1))
{triangulation.copy_triangulation (*triang);}
template <int dim>
elastic<dim>::~elastic ()
{
dof_handler.clear ();
}
and finily in main :
elastic<2> elast_opt() ;
elast_opt.one_step ;
...
after trying to make i get this error :
error: request for member ‘one_step’ in ‘elast_opt’, which is of non-class type ‘elastic<2>()’
i tried so many ways but no answer so any help would be appreciated .
regards
S.M.Mohseni
Feb 4, 2012 at 8:15pm UTC
This is a function declaration elastic<2> elast_opt() ;
Remove the parenthesis and it will hopefully work better elastic<2> elast_opt;