Errors, bugs, questions - page 2274

 
fxsaber:

If MQL5 compiles and executes code that C++ can't compile, is it a valid claim here that MQL5 does it by mistake?

It can't - because it finds unsolvable contradictions in them, which perhaps were overlooked in MQL

 
A100:

Can't - because it finds intractable contradictions in them, which were overlooked in the MQL.

It's just logic too, without attachment

Talking about different things. Finished.

 
TheXpert:
No, it's not the function signature I'm interested in, it's the internal class

I don't know how to look it up... if anyone knows, please write the result

 
Is this normal?
struct STRUCT { private: int a; };
STRUCT s = {0}; // 's' - cannot be initialized with initializer list
 
Konstantin:

which flags do you include?

typename T class T, C++ (gcc) - rextester
  • rextester.com
typename T class T in C++ (gcc)
 
fxsaber:
Is it normal?

Normal insofar as it is equivalent

struct STRUCT { private: int a; };
STRUCT s;
ZeroMemory( s ); //'s' - not allowed for objects with protected members or inheritance
 
A100:

OK, as far as equivalent.

I remember it used to be possible.

 

Error in the Documentation

struct MqlTradeResult 
  { 
   uint     retcode;          // Код результата операции 
   ulong    deal;             // Тикет сделки, если она совершена 
   ulong    order;            // Тикет ордера, если он выставлен 
   double   volume;           // Объем сделки, подтверждённый брокером 
   double   price;            // Цена в сделке, подтверждённая брокером 
   double   bid;              // Текущая рыночная цена предложения (цены реквота) 
   double   ask;              // Текущая рыночная цена спроса (цены реквота) 
   string   comment;          // Комментарий брокера к операции (по умолчанию заполняется расшифровкой кода возврата торгового сервера) 
   uint     request_id;       // Идентификатор запроса, устанавливается терминалом при отправке  
   uint     retcode_external; // Код ответа внешней торговой системы 
  };
template <typename T>
string GetName( T )
{
  return(typename(T));
}

void OnStart()
{
  MqlTradeResult Result = {0};
  
  Print(GetName(Result.retcode_external)); // int
}
Документация по MQL5: Константы, перечисления и структуры / Структуры данных / Структура результата торгового запроса
Документация по MQL5: Константы, перечисления и структуры / Структуры данных / Структура результата торгового запроса
  • www.mql5.com
В ответ на торговый запрос постановки ордера в торговую систему, торговый сервер возвращает данные, содержащие информацию о результате обработки торгового запроса в виде специальной предопределенной структуры MqlTradeResult. Код ошибки, которую вернула внешняя торговая система. Проставление и виды этих ошибок зависят от брокера и внешней...
 
A100:

I don't know how to look it up... If anyone knows, please write the result

typeid(x).name()

and then as you go along, depending on the compiler.

 
TheXpert:

typeid(x).name()

and then as you go, depending on the compiler.

Files:
cpp.txt  1 kb
Reason: