Skip to content

Instantly share code, notes, and snippets.

@JISyed
Created April 4, 2016 03:11
Show Gist options
  • Save JISyed/b814324aedac81600b602f0b7f4e844c to your computer and use it in GitHub Desktop.
Save JISyed/b814324aedac81600b602f0b7f4e844c to your computer and use it in GitHub Desktop.
A collection of C++ snippets that are useful for Xcode
//==================================================================
/// <#Insert description of new class here#>
class <#NewClassName#>
{
public:
//
// Essentials
//
// Default Ctor
<#NewClassName#>();
// Copy Ctor
<#NewClassName#>(const <#NewClassName#>& other);
// Copy Assignment
<#NewClassName#>& operator=(const <#NewClassName#>& rhs);
// Destructor
~<#NewClassName#>();
//
// Methods
//
<#methods#>
private:
//
// Data
//
<#data members#>
};
//==================================================================
// Default Ctor
<#NewClassName#>::<#NewClassName#>()
{
}
// Copy Ctor
<#NewClassName#>::<#NewClassName#>(const <#NewClassName#>& other)
{
other; // Use this somehow
}
// Copy Assignment Overload
<#NewClassName#>& <#NewClassName#>::operator=(const <#NewClassName#>& rhs)
{
if(this == &rhs)
{
return *this;
}
<#// Do assignments here#>
return *this;
}
// Dtor
<#NewClassName#>::~<#NewClassName#>()
{
}
//==================================================================
/// <#Describe the new enum here#>
enum <#NewEnumName#>
{
<#// new members here#>
};
//==================================================================
/// <#Describe new enum class here#>
enum class <#NewEnumClassName#> : int
{
<#// New members here#>
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment