IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
corsika
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Air Shower Physics
corsika
Commits
a95c1469
Commit
a95c1469
authored
3 years ago
by
ralfulrich
Committed by
Ralf Ulrich
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
specific utility file
parent
f39bb867
No related branches found
No related tags found
1 merge request
!352
Better examples
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
corsika/framework/utility/HasMethodSignature.hpp
+47
-0
47 additions, 0 deletions
corsika/framework/utility/HasMethodSignature.hpp
with
47 additions
and
0 deletions
corsika/framework/utility/HasMethodSignature.hpp
0 → 100644
+
47
−
0
View file @
a95c1469
#pragma once
/*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
*/
/**
* @file HasMethodSignature.hpp
*/
#include
<type_traits>
namespace
corsika
{
namespace
detail
{
/**
Helper traits class (partial) for static compile time checking.
Note, this is a poor replacement for C++20 concepts... they are
eagerly awaited!
It defines the default body of a generic test function returning
std::false_type.
In addition it defines the pattern for class-method matching with a
return type TReturn and function arguments TArgs... . Right now
both method signatures, "const" and "not const", are matched.
*/
template
<
typename
TReturn
,
typename
...
TArgs
>
struct
has_method_signature
{
// the non-const version
template
<
class
T
>
static
std
::
true_type
testSignature
(
TReturn
(
T
::*
)(
TArgs
...));
// the const version
template
<
class
T
>
static
std
::
true_type
testSignature
(
TReturn
(
T
::*
)(
TArgs
...)
const
);
};
}
// namespace detail
}
// namespace corsika
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment