## 18.3.4 Field Initializer Lists (cont.)

- E.g., necessary when assigning a size to a vector member:

  >     class PartDescription
  >     {
  >     public:
  >        PartDescription(String part_name,
  >           int inventory_number);
  >     private:
  >        const String name;
  >        const int part_number:
  >        vector<PartDescription*> subcomponents;
  >     };
  >     PartDescription::PartDescription(String part_name,
  >           int inventory_number)
  >        : name(part_name), part_number(inventory_number),
  >           subcomponents(3) {}

prev |top |next