fixed some "default assignment operator deleted" issues with GCC;
two more mapped CRT functions that don't exist in GCC
This commit is contained in:
Родитель
92fe5377d5
Коммит
22b7e0fc25
|
@ -150,6 +150,8 @@ static inline wchar_t* wcstok_s (wchar_t* s, const wchar_t* delim, wchar_t** ptr
|
|||
static inline int _stricmp (const char * a, const char * b) { return ::strcasecmp (a, b); }
|
||||
static inline int _strnicmp (const char * a, const char * b, wchar_t n) { return ::strncasecmp (a, b, n); }
|
||||
static inline int _wcsicmp (const wchar_t * a, const wchar_t * b) { return ::wcscasecmp (a, b); }
|
||||
static inline int64_t _strtoi64 (const char * s, char ** ep, int r) { return strtoll (s, ep, r); } // TODO: check if correct
|
||||
static inline uint64_t _strtoui64 (const char * s, char ** ep, int r) { return strtoull (s, ep, r); } // TODO: correct for size_t?
|
||||
// -- other
|
||||
static inline void Sleep (size_t ms) { std::this_thread::sleep_for (std::chrono::milliseconds (ms)); }
|
||||
#endif
|
||||
|
|
|
@ -244,6 +244,16 @@ namespace Microsoft { namespace MSR { namespace CNTK {
|
|||
m_separator = configParser.m_separator;
|
||||
m_configName = move(configParser.m_configName);
|
||||
}
|
||||
ConfigParser& operator=(const ConfigParser& configParser)
|
||||
{
|
||||
m_separator = configParser.m_separator;
|
||||
m_configName = configParser.m_configName;
|
||||
}
|
||||
ConfigParser& operator=(const ConfigParser&& configParser)
|
||||
{
|
||||
m_separator = configParser.m_separator;
|
||||
m_configName = move(configParser.m_configName);
|
||||
}
|
||||
|
||||
public:
|
||||
// FindBraces - find matching braces in a string starting at the current position
|
||||
|
@ -873,7 +883,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
|
|||
m_repeatAsterisk = repeatAsterisk;
|
||||
}
|
||||
|
||||
// copy and move constructors
|
||||
// copy and move constructors and assignment
|
||||
ConfigArray(const ConfigArray& configValue) : ConfigParser(configValue)
|
||||
{
|
||||
m_repeatAsterisk = true;
|
||||
|
@ -884,6 +894,18 @@ namespace Microsoft { namespace MSR { namespace CNTK {
|
|||
m_repeatAsterisk = true;
|
||||
*this = move(configValue);
|
||||
}
|
||||
ConfigArray& operator=(const ConfigArray& configValue)
|
||||
{
|
||||
ConfigParser::operator=(configValue);
|
||||
m_repeatAsterisk = true;
|
||||
*this = configValue;
|
||||
}
|
||||
ConfigArray& operator=(const ConfigArray&& configValue)
|
||||
{
|
||||
ConfigParser::operator=(move(configValue));
|
||||
m_repeatAsterisk = true;
|
||||
*this = move(configValue);
|
||||
}
|
||||
|
||||
// cast a configArray back to a string so we can return it as a ConfigValue
|
||||
operator ConfigValue()
|
||||
|
@ -951,7 +973,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
|
|||
for (int i=0;i < count;++i)
|
||||
{
|
||||
char buf[10];
|
||||
_itoa_s((int)size(), buf, 10);
|
||||
sprintf (buf, "%d", (int)size()); // TODO: left-over of Linux compat, can be done nicer
|
||||
std::string name = m_configName + '[' + buf + ']' ;
|
||||
push_back(ConfigValue(value, name));
|
||||
}
|
||||
|
@ -980,6 +1002,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
|
|||
template<typename T>
|
||||
class argvector : public std::vector<T>
|
||||
{
|
||||
typedef std::vector<T> B; using B::clear; using B::reserve;
|
||||
static void parse (const std::wstring & in, float & val) { val = (float) msra::strfun::todouble (in); }
|
||||
static void parse (const std::wstring & in, size_t & val) // convert wstring toks2[0] to T val and check type
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче