[GCC-XML]template question

David Beck dbeck at beckground.hu
Thu Mar 25 09:50:58 EST 2004


Hi There,

First let me express how much I appreciate the work you did.
I bumped into the project by accident although I'm looking  for a
solution for a problem for quite a long while. The XML files gccxml
creates almost fully solves that.

I tried an older 0.4.x version that dumped templated classes well, but
the new 0.6.0 version omits them. Did I overlook something?

I copy the content of my test file at the and of message.

Any comments are appreciated.
Best regards, 

David.

PS: I marked the missing classes with XXX


// $Id$

class cl_in_global_ns
{
	public:
		cl_in_global_ns() {}
		void void_void_fun() {}
		void void_int_fun(int param1) {}
		void void_int_int_fun(int param1, int param2);
};

void cl_in_global_ns::void_int_int_fun(int param1,int param2)
{
}

namespace N1
{
	class cl1_in_n1 {};
	class cl2_in_n1 : public cl1_in_n1 {};
	class cl3_in_n1 : public cl1_in_n1, virtual public cl_in_global_ns {};

	class cl4_in_n1
	{
		public:
			cl4_in_n1() {};
			virtual ~cl4_in_n1() {};
	};

	class cl5_in_n1 : virtual public cl4_in_n1, protected cl3_in_n1
	{
		public:
			cl5_in_n1() {};
			virtual ~cl5_in_n1() {}
	};

	namespace N11
	{
		class pimpl
		{
			public:
				pimpl() {}
				virtual ~pimpl() {}
				
			private:
				struct pimpl_impl;
				
				// no-copy
				pimpl & operator=(const pimpl& other);
				pimpl(const pimpl & other);
		};

		template <class A> class tmpl1 // XXX
		{
			public:
				const A a_;
				const A & retval_ret() const { return a_; }
				void do_sg(const A& a) {}
				tmpl1() : a_(0) {}
		};

		template <> class tmpl1<int> // XXX
		{
			public:
				void do_sg_else() {}
		};
	};
};

using namespace N1::N11;

int main()
{
	tmpl1<double> td; td.do_sg(double(1.0)); // XXX
	tmpl1<float>  tf; tf.do_sg(float(1.0));  // XXX
	tmpl1<int>    ti; ti.do_sg_else();       // XXX
	return 0;
}

// EOF








More information about the gccxml mailing list