Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Timo Koch
dune-common
Commits
23c9cd94
Commit
23c9cd94
authored
19 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
namespaces and some doxygen
[[Imported from SVN: r2116]]
parent
3e895449
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/misc.hh
+24
-21
24 additions, 21 deletions
common/misc.hh
with
24 additions
and
21 deletions
common/misc.hh
+
24
−
21
View file @
23c9cd94
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef __MISC_HH__
#define __MISC_HH__
/** \file
\brief Miscellaneous helper stuff
*/
#ifndef MISC_HH
#define MISC_HH
#include
<iostream>
#include
<sstream>
//! Check condition at compilation time
template
<
bool
flag
>
class
CompileTimeChecker
;
namespace
Dune
{
//! Check condition at compilation time
template
<
bool
flag
>
class
CompileTimeChecker
;
//! it exists only an implementation for true so the compiler throws an
//! error if the condition is false
template
<
>
class
CompileTimeChecker
<
true
>
{
};
//! it exists only an implementation for true so the compiler throws an
//! error if the condition is false
template
<
>
class
CompileTimeChecker
<
true
>
{
};
//! Map an integer value to a type
//! This comes in handy if one tries to emulate member function specialization.
//! The idea how to do it is presented in "Modern C++ Design" by Alexandrescu.
template
<
int
N
>
struct
Int2Type
{
enum
{
value
=
N
};
};
/** \brief Map an integer value to a type
This comes in handy if one tries to emulate member function specialization.
The idea how to do it is presented in "Modern C++ Design" by Alexandrescu.
*/
template
<
int
N
>
struct
Int2Type
{
enum
{
value
=
N
};
};
namespace
Dune
{
/** @addtogroup Common
@{
*/
/** \brief Compute the square of T */
template
<
class
T
>
T
SQR
(
T
t
)
{
return
t
*
t
;
}
//********************************************************************
//
// generate filenames with timestep number in it
//
//********************************************************************
/** \brief Generate filenames with timestep number in it */
inline
std
::
string
genFilename
(
const
std
::
string
&
path
,
const
std
::
string
&
fn
,
int
ntime
,
...
...
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