This patch fixes a series of warnings like:
{{{
In file included from ../../master/src/mathed/InsetMathBoldSymbol.cpp:13:
In file included from ../../master/src/mathed/InsetMathBoldSymbol.h:15:
../../master/src/mathed/InsetMathNest.h:37:7: warning: 'lyx::InsetMathNest::metrics' hides overloaded virtual function [-Woverloaded-virtual]
void metrics(MetricsInfo const & mi) const;
^
../../master/src/insets/Inset.h:186:15: note: hidden overloaded virtual function 'lyx::Inset::metrics' declared here: different number of parameters
(2 vs 1)
virtual void metrics(MetricsInfo & mi, Dimension & dim) const = 0;
^
}}}
For a description of the problem, see for example:
http://stackoverflow.com/questions/18515183/c-overloaded-virtual-function-warning-by-clang
3 different strategies have been used:
* in frontend, some functions have been renamed.
* in InsetMath.h, Inset::write has been explicitly imported too
* in InsetMathNest.h, since a comment said that hiding Inset::metrics is intended, a special trick has bee used to silence the warning.
This is needed since all formats are stored in a global list which is shared
between threads, but never modfified except from the main thread.
The only missing bit is extension_list_, which is not so easy to do.
If we compile in C++11 mode, do not use the boost replacements for bind,
functional and shared_ptr. regex is excluded, since it misses match_partial, and
gcc does not provide a usable one in versions less than 4.9.0.
I also removed the #define for match_partial, since this is dangerous. Now you
get a compile error instead of subtle runtime differences.
The old detection did only work if CFLAGS contained -std=c++11, since ciso646
was only included for __cplusplus > 199711.
Thanks to Koernel for the cmake part.
Now all const methods may be called without additional locking.
This is assumed by the threaded LaTeX export, which always useses a globally
unique instance for each encoding.
Read-only access to these classes is now threadsafe, with one exception:
The encoding neds to be already initialized (i.e. init() must not be called).
This makes bug 9336 unreproducable on my machine, although it is not completely
fixed yet.
The interface is now 100% unit tested, and the typedefs depend on the new
STD_STRING_USES_COW configuration variable. The only missing bit is to detect
clang and disable STD_STRING_USES_COW for clang.
As discused on the list. This is not used yet, but it is intended to provide
thread-safe read-access without the need for synchronization if the used STL
implementation does not provide it for std::basic_string. This is the case for
all implementations using copy-on-write.
docstring is already defined in strfwd.h (which is included from docstring.h).
There are only two possible cases:
Either the typedef in docstring.h defines an identical type (then it is not
needed), or it defines a different type (then it generates a compilation error)
=> it is not needed.