[antlr-interest] CircularQueue compilation question, please help.

Ric Klaren klaren at cs.utwente.nl
Tue Mar 19 01:35:11 PST 2002


On Tue, Mar 19, 2002 at 05:37:12AM -0000, jeff_c_lin wrote:
> I have a question about the way CircularQueue is defined. It has a private
> copy contructor and private assignment operator but they are not defined
> anywhere (no CircularQueue.cpp). What's the purpose of these and why don't
> they cause compilation error?

This prevents unintended use of default copy/assignment
constructor/operators. As long as the constructor/operator is not used
there is no problem. In the case of CircularQueue it might not be necessary
to do this, I disabled all copy assignment constructors for classes that do
not explicitly support them.

> I'm trying to compile antlr classes as an DLL, and I'm getting C4661
> warning message. I instantiate CircularQueue when I see it used in as an
> class member. For example, class InputBuffer has a CircularQueue<int>
> member. According the MS Knowledge base, I need to instantiate a template
> class in order to export it from an DLL. So after InputBuffer class
> declaration, I do "template class DLLIMEXPORT CircularQueue<int>", but the
> compiler warns that CircularQueue's member functions are not defined. I'm
> surprised it's not an error. Anyone knows what's going on here? How do I
> get rid of the warning messages?

Ignore them or use the appropriate #pragma or whatever MSVC uses. Depending
on the version of antlr, the version of windows and the version of MSVC
(and the STL you use) you may not succceed building a dll. Search the
archives for some discussions on the subject (you may have to switch to


    ---- Ric Klaren ----- klaren at cs.utwente.nl ----- +31 53 4893722  ----
  "I don't have anything against Java - it's the best damn implementation
				  of UCSD Pascal ever released..." --- Larry Smith


Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

More information about the antlr-interest mailing list