Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Programming in C++ 2022
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sdlbio-courses
Programming in C++ 2022
Commits
d2959e7d
Commit
d2959e7d
authored
3 years ago
by
Sandipan Mohanty
Browse files
Options
Downloads
Patches
Plain Diff
Add the missing Vbose header
parent
78f6decf
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/include/Vbose.hh
+76
-0
76 additions, 0 deletions
code/include/Vbose.hh
with
76 additions
and
0 deletions
code/include/Vbose.hh
0 → 100644
+
76
−
0
View file @
d2959e7d
#pragma once
#include
<iomanip>
#include
<iostream>
#include
<string>
class
Vbose
{
public:
Vbose
()
{
std
::
cout
<<
"Default constructor of object at "
<<
((
size_t
)
this
)
<<
"
\n
"
;
}
inline
auto
getval
()
const
{
return
nm
;
}
inline
void
setval
(
const
std
::
string
&
nw
)
{
nm
=
nw
;
}
Vbose
(
const
Vbose
&
v
)
:
nm
(
v
.
nm
)
{
std
::
cout
<<
"Copy constructor of object at "
<<
((
size_t
)
this
)
<<
". "
;
std
::
cout
<<
"Source for copy is at "
<<
((
size_t
)
&
v
)
<<
"
\n
"
;
}
Vbose
(
Vbose
&&
v
)
noexcept
:
nm
(
std
::
move
(
v
.
nm
))
{
std
::
cout
<<
"Move constructor of object at "
<<
((
size_t
)
this
)
<<
". "
;
std
::
cout
<<
"Source for move is at "
<<
((
size_t
)
&
v
)
<<
"
\n
"
;
}
Vbose
(
std
::
string
gs
)
noexcept
:
nm
(
gs
)
{
std
::
cout
<<
"Constructor of object at "
<<
((
size_t
)
this
)
<<
","
;
std
::
cout
<<
" using string "
<<
std
::
quoted
(
gs
)
<<
"
\n
"
;
}
auto
operator
=
(
const
Vbose
&
v
)
->
Vbose
&
{
std
::
cout
<<
"Assignment operator: LHS @ "
<<
((
size_t
)
this
)
<<
"("
<<
nm
<<
"), "
;
std
::
cout
<<
"RHS @ "
<<
((
size_t
)
&
v
)
<<
"("
<<
std
::
quoted
(
v
.
nm
)
<<
")
\n
"
;
if
(
this
!=
&
v
)
{
nm
=
v
.
nm
;
}
return
*
this
;
}
auto
operator
=
(
Vbose
&&
v
)
->
Vbose
&
{
std
::
cout
<<
"Move assignment operator: LHS @ "
<<
((
size_t
)
this
)
<<
"("
<<
std
::
quoted
(
nm
)
<<
"), "
;
std
::
cout
<<
"RHS @ "
<<
((
size_t
)
&
v
)
<<
"("
<<
std
::
quoted
(
v
.
nm
)
<<
")
\n
"
;
std
::
swap
(
nm
,
v
.
nm
);
return
*
this
;
}
~
Vbose
()
{
std
::
cout
<<
"Destructor of object at "
<<
((
size_t
)
this
)
<<
" with data "
<<
std
::
quoted
(
nm
)
<<
"
\n
"
;
}
auto
operator
+
(
const
Vbose
&
v
)
->
Vbose
{
std
::
cout
<<
"Inside operator + ()
\n
"
;
return
{
nm
+
"+"
+
v
.
nm
};
}
auto
value
()
const
noexcept
->
std
::
string
{
return
nm
;
}
void
value
(
const
std
::
string
&
vl
)
{
std
::
cout
<<
"Changing internal value of object at "
<<
((
size_t
)
this
)
<<
" from "
<<
nm
<<
" to "
<<
vl
<<
"
\n
"
;
nm
=
vl
;
}
private
:
std
::
string
nm
{
"Uninitialized"
};
};
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