Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cppTests
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dominik Thoennes
cppTests
Commits
781e2b1e
Commit
781e2b1e
authored
4 years ago
by
Dominik Thoennes
Browse files
Options
Downloads
Patches
Plain Diff
show usage of extern
parent
50d30f00
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
explicit-templates/Hund.cpp
+1
-6
1 addition, 6 deletions
explicit-templates/Hund.cpp
explicit-templates/Hund.hpp
+6
-3
6 additions, 3 deletions
explicit-templates/Hund.hpp
with
7 additions
and
9 deletions
explicit-templates/Hund.cpp
+
1
−
6
View file @
781e2b1e
...
@@ -6,12 +6,7 @@ void Hund<FOO>::bar(){
...
@@ -6,12 +6,7 @@ void Hund<FOO>::bar(){
bellen
<
FOO
>
();
bellen
<
FOO
>
();
}
}
template
<
class
FOO
>
void
bellen
(){
std
::
cout
<<
"wuff"
<<
std
::
endl
;
}
template
class
Hund
<
double
>;
template
class
Hund
<
double
>;
//
template void bellen<double>();
template
void
bellen
<
double
>();
This diff is collapsed.
Click to expand it.
explicit-templates/Hund.hpp
+
6
−
3
View file @
781e2b1e
#pragma once
#pragma once
#include
<iostream>
template
<
class
FOO
>
template
<
class
FOO
>
class
Hund
{
class
Hund
{
...
@@ -6,7 +7,9 @@ class Hund {
...
@@ -6,7 +7,9 @@ class Hund {
void
bar
();
void
bar
();
};
};
template
<
class
FOO
>
template
<
class
FOO
>
void
bellen
();
void
bellen
(){
std
::
cout
<<
"wuff"
<<
std
::
endl
;
}
//extern template void bellen<double>();
extern
template
void
bellen
<
double
>();
\ No newline at end of file
\ No newline at end of file
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