<commit_before>/*
 *	Delegate.h
 *	Efficient delegates in C++ that generate only two lines of asm code
 *
 *	Created by <NAME>.
 *	Contributions by <NAME>.
 *	Tweaked by <NAME> on 5/18/09.
 *	http://www.codeproject.com/KB/cpp/FastDelegate.aspx
 *  http://www.codeproject.com/Articles/7150/Member-Function-Pointers-and-the-Fastest-Possible
 *
 *	License:
 *	As stated explicitly in the article linked above, this code is released into the public domain
 *	and may be used for any purpose.
 *
 */

//	Delegates.h
//	Efficient delegates in C++ that generate only two lines of asm code!
//	Documentation is found at http://www.codeproject.com/KB/cpp/FastDelegate.aspx
//
//	By <NAME>, Mar 2004.
//	Major contributions were made by <NAME>.
//
// History:
//
// 24-Apr-04 1.0  * Submitted to CodeProject.
// 28-Apr-04 1.1  * Prevent most unsafe uses of evil static function hack.
//				  * Improved syntax for horrible_cast (thanks Paul Bludov).
//				  * Tested on Metrowerks MWCC and Intel ICL (IA32)
//				  * Compiled, but not run, on Comeau C++ and Intel Itanium ICL.
//	27-Jun-04 1.2 * Now works on Borland C++ Builder 5.5
//				  * Now works on /clr "managed C++" code on VC7, VC7.1
//				  * Comeau C++ now compiles without warnings.
//				  * Prevent the virtual inheritance case from being used on
//					  VC6 and earlier, which generate incorrect code.
//				  * Improved warning and error messages. Non-standard hacks
//					 now have compile-time checks to make them safer.
//				  * implicit_cast used instead of static_cast in many cases.
//				  * If calling a const member function, a const class pointer can be used.
//				  * MakeDelegate() global helper function added to simplify pass-by-value.
//				  * Added fastdelegate.clear()
// 16-Jul-04 1.2.1* Workaround for gcc bug (const member function pointers in templates)
// 30-Oct-04 1.3  * Support for (non-void) return values.
//				  * No more workarounds in client code!
//					 MSVC and Intel now use a clever hack invented by <NAME>:
//					 - The FASTDELEGATEDECLARE workaround is no longer necessary.
//					 - No more warning messages for VC6
//				  * Less use of macros. Error messages should be more comprehensible.
//				  * Added include guards
//				  * Added delegate::empty() to test if invocation is safe (Thanks <NAME>).
//				  * Now tested on VS 2005 Express Beta, PGI C++
// 24-Dec-04 1.4  * Added DelegateMemento, to allow collections of disparate delegates.
//				  * <,>,<=,>= comparison operators to allow storage in ordered containers.
//				  * Substantial reduction of code size, especially the 'Closure' class.
//				  * Standardised all the compiler-specific workarounds.
//				  * MFP conversion now works for CodePlay (but not yet supported in the full code).
//				  * Now compiles without warnings on _any_ supported compiler, including BCC 5.5.1
//				  * New syntax: delegate< int (char *, double) >.
// 14-Feb-05 1.4.1* Now treats =0 as equivalent to .clear(), ==0 as equivalent to .empty(). (Thanks elfric).
//				  * Now tested on Intel ICL for AMD64, VS2005 Beta for AMD64 and Itanium.
// 30-Mar-05 1.5  * Safebool idiom: "if (dg)" is now equivalent to "if (!dg.empty())"
//				  * Fully supported by CodePlay VectorC
//				  * Bugfix for Metrowerks: empty() was buggy because a valid MFP can be 0 on MWCC!
//				  * More optimal assignment,== and != operators for static function pointers.
//
// 19-May-09 1.5a <NAME>:
//				  * Bundled with Signals.h for signals and slots library
//				  * Changed namespace to "Gallant"
// 05-Jul-16 1.5b <NAME>:
//				  * Bundled with Signals.h for signals and slots library
//				  * Changed namespace to "Rt"

#ifndef _Delegate_H_
#define _Delegate_H_

#if _MSC_VER > 1000
	#pragma once
#endif // _MSC_VER > 1000

#include <memory.h> // to allow <,> comparisons

////////////////////////////////////////////////////////////////////////////////
//						Configuration options
//
////////////////////////////////////////////////////////////////////////////////
<commit_msg>Fixed we don't have memory.h<commit_after>/*
 *	Delegate.h
 *	Efficient delegates in C++ that generate only two lines of asm code
 *
 *	Created by <NAME>.
 *	Contributions by <NAME>.
 *	Tweaked by <NAME> on 5/18/09.
 *	http://www.codeproject.com/KB/cpp/FastDelegate.aspx
 *  http://www.codeproject.com/Articles/7150/Member-Function-Pointers-and-the-Fastest-Possible
 *
 *	License:
 *	As stated explicitly in the article linked above, this code is released into the public domain
 *	and may be used for any purpose.
 *
 */

//	Delegates.h
//	Efficient delegates in C++ that generate only two lines of asm code!
//	Documentation is found at http://www.codeproject.com/KB/cpp/FastDelegate.aspx
//
//	By <NAME>, Mar 2004.
//	Major contributions were made by <NAME>.
//
// History:
//
// 24-Apr-04 1.0  * Submitted to CodeProject.
// 28-Apr-04 1.1  * Prevent most unsafe uses of evil static function hack.
//				  * Improved syntax for horrible_cast (thanks <NAME>).
//				  * Tested on Metrowerks MWCC and Intel ICL (IA32)
//				  * Compiled, but not run, on Comeau C++ and Intel Itanium ICL.
//	27-Jun-04 1.2 * Now works on Borland C++ Builder 5.5
//				  * Now works on /clr "managed C++" code on VC7, VC7.1
//				  * Comeau C++ now compiles without warnings.
//				  * Prevent the virtual inheritance case from being used on
//					  VC6 and earlier, which generate incorrect code.
//				  * Improved warning and error messages. Non-standard hacks
//					 now have compile-time checks to make them safer.
//				  * implicit_cast used instead of static_cast in many cases.
//				  * If calling a const member function, a const class pointer can be used.
//				  * MakeDelegate() global helper function added to simplify pass-by-value.
//				  * Added fastdelegate.clear()
// 16-Jul-04 1.2.1* Workaround for gcc bug (const member function pointers in templates)
// 30-Oct-04 1.3  * Support for (non-void) return values.
//				  * No more workarounds in client code!
//					 MSVC and Intel now use a clever hack invented by <NAME>:
//					 - The FASTDELEGATEDECLARE workaround is no longer necessary.
//					 - No more warning messages for VC6
//				  * Less use of macros. Error messages should be more comprehensible.
//				  * Added include guards
//				  * Added delegate::empty() to test if invocation is safe (Thanks <NAME>).
//				  * Now tested on VS 2005 Express Beta, PGI C++
// 24-Dec-04 1.4  * Added DelegateMemento, to allow collections of disparate delegates.
//				  * <,>,<=,>= comparison operators to allow storage in ordered containers.
//				  * Substantial reduction of code size, especially the 'Closure' class.
//				  * Standardised all the compiler-specific workarounds.
//				  * MFP conversion now works for CodePlay (but not yet supported in the full code).
//				  * Now compiles without warnings on _any_ supported compiler, including BCC 5.5.1
//				  * New syntax: delegate< int (char *, double) >.
// 14-Feb-05 1.4.1* Now treats =0 as equivalent to .clear(), ==0 as equivalent to .empty(). (Thanks elfric).
//				  * Now tested on Intel ICL for AMD64, VS2005 Beta for AMD64 and Itanium.
// 30-Mar-05 1.5  * Safebool idiom: "if (dg)" is now equivalent to "if (!dg.empty())"
//				  * Fully supported by CodePlay VectorC
//				  * Bugfix for Metrowerks: empty() was buggy because a valid MFP can be 0 on MWCC!
//				  * More optimal assignment,== and != operators for static function pointers.
//
// 19-May-09 1.5a <NAME>:
//				  * Bundled with Signals.h for signals and slots library
//				  * Changed namespace to "Gallant"
// 05-Jul-16 1.5b <NAME>:
//				  * Bundled with Signals.h for signals and slots library
//				  * Changed namespace to "Rt"

#ifndef _Delegate_H_
#define _Delegate_H_

#if _MSC_VER > 1000
	#pragma once
#endif // _MSC_VER > 1000

//#include <memory.h> // to allow <,> comparisons

////////////////////////////////////////////////////////////////////////////////
//						Configuration options
//
////////////////////////////////////////////////////////////////////////////////

{'fraction_non_alphanumeric': 0.1486452895848869, 'fraction_numerical': 0.02734277902063137, 'mean_word_length': 2.35431429762401, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3776583', 'n_tokens_mistral': 2855, 'n_tokens_neox': 2386, 'n_words': 947}