Chic documentation
Houlder Technologies


Limitations
Home
Features
Tutorial
Examples
FAQ
Reference
Download
Mailing list
Contact

Limitations on generation

There are a few cases where Chic is not yet able to generate all the necessary declarations without a little help from the programmer. These are:

Templates

Chic does not yet instantiate templates, so for the hic-file with the contents

  struct C
  {
    Vector<D> vec;
  };
Chic only generates a forward declaration for D even if it may be that the instantiation of Vector requires the full definition of D.

Covariant return types

In the following code where Chic has parsed the files

File classes.hh:

  struct Base {};
  struct Derived : public Base {};
File basecreator.hh:
  struct BaseCreator
  {
    virtual
    Base*
    create() = 0;
  };
and we generate from the hic-file

File creator.hic:

  struct ConcreteCreator : public BaseCreator
  {
    virtual
    Derived*
    create()
    {
      return new Derived;
    }
  };
Chic erroneously forward declares Derived instead of including classes.hh.

Default parameters

In the following code, even if A is a known type Chic will only forward declare A in the header.

  void
  f(A a = A())
  {
  }

In all these cases it's just to use sections to include the necessary files.





Home