use call-by-value with std::move() function
This commit is contained in:
@ -22,6 +22,7 @@
|
||||
#include "utils.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <utility>
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
@ -68,8 +69,8 @@ This function is useful in combination with :cpp:func:`utils::open_potential`.
|
||||
* \param fp File descriptor of the already opened file
|
||||
* \param filetype Description of file type for error messages */
|
||||
|
||||
TextFileReader::TextFileReader(FILE *fp, const std::string &filetype) :
|
||||
filetype(filetype), closefp(false), fp(fp), ignore_comments(true)
|
||||
TextFileReader::TextFileReader(FILE *fp, std::string filetype) :
|
||||
filetype(std::move(filetype)), closefp(false), fp(fp), ignore_comments(true)
|
||||
{
|
||||
if (fp == nullptr) throw FileReaderException("Invalid file descriptor");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user