Skip to content

Commit

Permalink
add string_view
Browse files Browse the repository at this point in the history
  • Loading branch information
YanzhaoW committed Sep 21, 2023
1 parent bec027c commit c5a0417
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions template/NewTask/base/NewTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
namespace R3B
{
// ---- Standard Constructor ------------------------------------------
NewTask::NewTask(const TString& name, Int_t iVerbose)
: FairTask(name, iVerbose)
NewTask::NewTask(std::string_view name, int iVerbose)
: FairTask(name.data(), iVerbose)
{
}

Expand Down
3 changes: 2 additions & 1 deletion template/NewTask/base/NewTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <R3BIOConnector.h>
#include <R3BNeulandCalData.h>
#include <R3BNeulandHit.h>
#include <string>

// namespace here is optional.
namespace R3B
Expand All @@ -31,7 +32,7 @@ namespace R3B
NewTask();

// Standard constructor
explicit NewTask(const TString& name, Int_t iVerbose = 1);
explicit NewTask(std::string_view name, int iVerbose = 1);

// Other speical functions. Either define all these 5 functions or none of them (rule of 5).
// Defining none of them is preferred (rule of 0).
Expand Down

0 comments on commit c5a0417

Please sign in to comment.