Thanks so much, Vadim.  There were three such compile errors and this fixed two of them.
Adding the following fixed the third:


    %ignore std::vector<CppClassName>::pop;

With this, it compiled and worked!

Thanks, again.
-Chris

------------------------------------------------------------------------------
From: Vadim Zeitlin <vz-swig@ze...> - 2013-05-22 16:14


Hello,

I use the following before the %template directive for the classes without default ctor:

      %ignore std::vector<CppClassName>::vector(size_type);
      %ignore std::vector<CppClassName>::resize;

HTH,

VZ


-------- Original Message --------
Subject: std::vector of class with no default constructor
Date: Wed, 22 May 2013 11:30:40 -0400
From: Botos, Christopher <cbotos@aer.com>
To: swig-user@lists.sourceforge.net.


Hi,

I have a struct that contains a member that is a vector of a class with no default constructor that is not compiling.  I condensed the problem into the short example below that gives a few of the following compile errors:
    error: no matching function for call to Instrument::Instrument()
I tried applying what is said about this in  Section 6.6.1 "Constructors and destructors" but without success.
Can someone suggest how I might get around this?
Here's the example code:


//---------------------------------------------------------
%module Band
%feature("autodoc", "1");

//%feature("valuewrapper") Instrument;
//%clearnodefaultctor;
//%nodefaultctor Instrument;
//%feature("notabstract") Instrument;

%{
#define SWIG_FILE_WITH_INIT
#include <vector>

class Instrument
{
   public:
      Instrument(int aNote) : theNote(aNote) {}
      int play() {return theNote;}
   private:
      int theNote;
};

struct Section
{
   std::vector<Instrument> theInstruments;
};
%}

%include "std_vector.i"

typedef std::list<PG::L2::LS::DateTime> DateTimeVector;
typedef std::vector<Instrument> InstrumentVector;
%template(InstrumentVector) std::vector<Instrument>;
//---------------------------------------------------------

Thanks in advance.
Regards,
Chris