Compatibility with clang [#CONV-2807].

This commit is contained in:
Alexey Milovidov 2013-01-06 16:07:01 +00:00
parent 3e50a4f63b
commit c3e3b66dc4
2 changed files with 3 additions and 27 deletions

View File

@ -1,5 +1,4 @@
#ifndef MYSQLXX_ROW_H
#define MYSQLXX_ROW_H
#pragma once
#include <mysqlxx/Types.h>
#include <mysqlxx/String.h>
@ -22,14 +21,6 @@ class ResultBase;
*/
class Row
{
private:
/** @brief Pointer to bool data member, for use by safe bool conversion operator.
* @see http://www.artima.com/cppsource/safebool.html
* Взято из mysql++.
*/
typedef MYSQL_ROW Row::*private_bool_type;
void this_type_does_not_support_comparisons() const {}
public:
/** Для возможности отложенной инициализации. */
Row() : row(NULL), res(NULL)
@ -92,22 +83,5 @@ private:
};
/** Следующие две функции генерируют ошибку компиляции при попытке использовать операторы == или !=.
*/
template <typename T>
bool operator!=(const Row & lhs, const T & rhs)
{
lhs.this_type_does_not_support_comparisons();
return false;
}
template <typename T>
bool operator==(const Row & lhs, const T & rhs)
{
lhs.this_type_does_not_support_comparisons();
return false;
}
}
#endif

View File

@ -184,6 +184,8 @@ private:
}
else
throwException("Cannot parse Date");
return 0; /// чтобы не было warning-а.
}