Errors, bugs, questions - page 1730
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
That's right, here in typing, T = A *
Then there is a compilation error here
Exactly. I read all these claims and still can't understand where the problem is. Are you going to store these files on a floppy disk?
Does it wear out your disk when you save a 100K file instead of a 50K one? (Isn't that funny to you? )
Is it normal that because of a single copyright character (which in principle is international and is in all encodings, even though its code is greater than 127) the file size is doubled without any sense? Isn't it clever? Why bloat files by 2 times without any need?
It's not just the size that's the problem, it's also the contextual search. As long as the files are in ASCII, you can use many third-party programs, including file managers, to search for files using the context string. I use this almost every day. The native MQ editor is as zilch in this regard as in many other obvious coding issues. Once we've got unicode, context search has two problems: not all programs can or want to do that, and for those who can, we get point 2 - slowness.
Of course, some people find it easier to buy a faster computer in addition to the hard drive than to think or at least learn from other products how user-friendly and efficient software should be.
Then there is a compilation error here
In C++ too there is ambiguity of the type: const T const
But there is a way out - move const to the right
void f1( T const & a[] ) {} //error: 'const' - unexpected token
class A {};
void f2( A const * const & a[] ) {} //нормально
class B {
void g1() const { f1( a ); } //error: 'f1' - cannot to apply function template
void g2() const { f2( a ); } //нормально
A *a[];
};
In C++ too, there is ambiguity of the type: const T const
But there is a way out - move const to the right
C++ compiles without errors (given the syntax difference)But logically it's strange when "const A" and "A const" mean the same thing.
Perhaps"Aconst*" is a constant pointer to a non-const object.
This seems to be the case. Because such a construct exists.
void f( const A const * const & a[] ) {}
You cannot change the pointer, you cannot change by reference and you cannot change the object(s).
From the viewpoint of getting fast code, could such a construct give the compiler a proper hint?
Is it normal that a single copyright character (which in principle is international and is present in all encodings, despite the fact that its code is bigger than 127) causes the file size to increase by 2 times...
void f( const A const * & a[] ) {}
You can't change the elements, but you can change the size of the array.
Funny, it turns out that methods can look like this
class B
{
const A const * Method( const A const * const & a[] ) const
{
return(a[0]);
}
};
It is possible that"Aconst*" is a constant pointer not to a constant object.
If not a pattern, then "A const *" equals "const A *", and if a pattern, then by situation
{
public:
int i;
};
void f( A const * & a[] )
{
a[0].i = 1; // 'i' - constant cannot be modified
}
Specifically this - fixed in the future https://www.mql5.com/ru/forum/1111/page1749#comment_2892563
If not a pattern, then "A const *" equals "const A *", and if a pattern - by that situation (in C++ )
It's interesting that in a design like this...
void f( const A const * & a[] ) {}
elements cannot be changed, but the size of the array can be changed.