diff --git a/include/etl/delegate.h b/include/etl/delegate.h index d3f9a5c1..3d264bcd 100644 --- a/include/etl/delegate.h +++ b/include/etl/delegate.h @@ -139,6 +139,17 @@ namespace etl return delegate(const_method_instance_stub); } +#if !defined(ETL_COMPILER_GCC) + //************************************************************************* + /// Create from instance function operator (Compile time). + //************************************************************************* + template + static delegate create() + { + return delegate(operator_instance_stub); + } +#endif + //************************************************************************* /// Execute the delegate. //************************************************************************* @@ -305,6 +316,17 @@ namespace etl return (Instance.*Method)(params...); } +#if !defined(ETL_COMPILER_GCC) + //************************************************************************* + /// Stub call for a function operator. Compile time instance. + //************************************************************************* + template + static TReturn operator_instance_stub(void*, TParams... params) + { + return Instance.operator()(params...); + } +#endif + //************************************************************************* /// Stub call for a free function. //************************************************************************* diff --git a/include/etl/version.h b/include/etl/version.h index 58d3e5ab..7ef7d2b3 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -39,7 +39,7 @@ SOFTWARE. #define ETL_VERSION_MAJOR 14 #define ETL_VERSION_MINOR 24 -#define ETL_VERSION_PATCH 0 +#define ETL_VERSION_PATCH 1 #define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) ETL_STRINGIFY(ETL_VERSION_MINOR) ETL_STRINGIFY(ETL_VERSION_PATCH) #define ETL_VERSION_W ETL_WIDE_STRING(ETL_CONCAT(ETL_CONCAT(ETL_VERSION_MAJOR, ETL_VERSION_MINOR), ETL_VERSION_PATCH)) diff --git a/support/Release notes.txt b/support/Release notes.txt index 70a5a029..5b4e626b 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,7 @@ +=============================================================================== +14.24.1 +Added compile time functor version of 'create()'. + =============================================================================== 14.24.0 Added 'delegate' and 'delegate_service'. diff --git a/test/test_delegate.cpp b/test/test_delegate.cpp index e2a76bd7..55c6c35b 100644 --- a/test/test_delegate.cpp +++ b/test/test_delegate.cpp @@ -46,8 +46,6 @@ namespace int d; }; - Data data; - //***************************************************************************** // The free function taking no parameters. //***************************************************************************** @@ -273,6 +271,28 @@ namespace CHECK(function_called); } +#if !defined(ETL_COMPILER_GCC) + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_member_operator_void_compile_time) + { + etl::delegate d = etl::delegate::create(); + + d(); + + CHECK(function_called); + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_member_operator_void_compile_time_const) + { + etl::delegate d = etl::delegate::create(); + + d(); + + CHECK(function_called); + } +#endif + //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_member_operator_void) { diff --git a/test/vs2017/Debug LLVM/.gitignore b/test/vs2017/Debug LLVM/.gitignore new file mode 100644 index 00000000..998d6c2d --- /dev/null +++ b/test/vs2017/Debug LLVM/.gitignore @@ -0,0 +1,7 @@ +/random_clcg.csv +/random_hash.csv +/random_lcg.csv +/random_lsfr.csv +/random_mwc.csv +/random_pcg.csv +/random_xorshift.csv diff --git a/test/vs2017/etl.sln b/test/vs2017/etl.sln index 553eb8ef..b7bfc67b 100644 --- a/test/vs2017/etl.sln +++ b/test/vs2017/etl.sln @@ -9,6 +9,8 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug 64|Win32 = Debug 64|Win32 Debug 64|x64 = Debug 64|x64 + Debug LLVM|Win32 = Debug LLVM|Win32 + Debug LLVM|x64 = Debug LLVM|x64 Debug No Unit Tests|Win32 = Debug No Unit Tests|Win32 Debug No Unit Tests|x64 = Debug No Unit Tests|x64 Debug|Win32 = Debug|Win32 @@ -21,6 +23,10 @@ Global {C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug 64|Win32.Build.0 = Debug No Unit Tests|Win32 {C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug 64|x64.ActiveCfg = Debug64|x64 {C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug 64|x64.Build.0 = Debug64|x64 + {C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug LLVM|Win32.ActiveCfg = Debug LLVM|Win32 + {C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug LLVM|Win32.Build.0 = Debug LLVM|Win32 + {C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug LLVM|x64.ActiveCfg = Debug LLVM|x64 + {C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug LLVM|x64.Build.0 = Debug LLVM|x64 {C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug No Unit Tests|Win32.ActiveCfg = Debug No Unit Tests|Win32 {C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug No Unit Tests|Win32.Build.0 = Debug No Unit Tests|Win32 {C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug No Unit Tests|x64.ActiveCfg = Debug No Unit Tests|x64 diff --git a/test/vs2017/etl.vcxproj b/test/vs2017/etl.vcxproj index b6bad029..331a6f54 100644 --- a/test/vs2017/etl.vcxproj +++ b/test/vs2017/etl.vcxproj @@ -1,6 +1,14 @@  + + Debug LLVM + Win32 + + + Debug LLVM + x64 + Debug64 Win32 @@ -48,12 +56,24 @@ v141 Unicode + + Application + true + llvm + Unicode + Application true v141 Unicode + + Application + true + v141 + Unicode + Application true @@ -98,9 +118,15 @@ + + + + + + @@ -125,10 +151,19 @@ true \$(IntDir) + + false + true + \$(IntDir) + true true + + true + true + true true @@ -175,6 +210,28 @@ $(OutDir)\etl.exe + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + ../../../unittest-cpp/UnitTest++/;../../include;../../include/etl/c;../../test + + + false + stdcpp14 + false + + + Console + false + + + "$(OutDir)etl.exe" + + @@ -196,6 +253,27 @@ $(OutDir)\etl.exe + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + ../../unittest-cpp/UnitTest++/;../../include/etl;../../include/etl/c;../../test + + + false + stdcpp14 + + + Console + true + + + $(OutDir)\etl.exe + + @@ -617,7 +695,9 @@ false false false + false false + false false false false @@ -638,7 +718,9 @@ false + false false + false false false false @@ -654,31 +736,41 @@ false + false false + false false false false + false false + false false false false + false false + false false false false + false false + false false false false + false false + false false false @@ -689,7 +781,9 @@ false + false false + false false false false @@ -699,7 +793,9 @@ true true false + false false + false false false @@ -718,7 +814,9 @@ false + false false + false false false false