examples/before/example_classes.h
author William Roberts <williamr@symbian.org>
Mon, 14 Jun 2010 15:47:21 +0100
changeset 7 8c4a7869f673
parent 5 29cf076edbda
permissions -rw-r--r--
Add heuristic for guessing the source file associated with assembler errors Generalise text in error: pasting "xxx" and "yyy" does not give a valid preprocessing token Ignore "No such file or directory", as these are unlikely to be gcc specific.

// Copyright (c) 2010 Symbian Foundation Ltd.
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of the License "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Symbian Foundation - Initial contribution
// 
// Description:
// Examples of things which GCC does not like in the Symbian codebase.

// Various problems with classes

class TClass1
	{
	public:
	TClass1(int a, int b);
	int TClass1::Average();			// Error! Member function name should not be qualified
	
	private:
	int iA;
	int iB;
	};


// Correct refenrencing of types defined inside a class Template
// Symptom GCC : Error: Expected initializer before ' (class name)' 

template <class T>
class list {
	public:
	typedef unsigned int myType;
	myType setSize (unsigned int x, unsigned int y);
	};
 
template<class T>	
inline  list<T>::myType list<T>::setSize (unsigned int x, unsigned int y) //This line will throw the error

	{  
         return (x*y);
	};



// Need to use  \x to specify the character code directly
char* literals()
   {
   char* string = "123£456";

   return string;
   }