C++ auto-indentation usually works fine, as long as your code resembles C code. However, when you start doing something more elaborate, auto-indentation screws completely the formatting of the files. For example:
template < optimize_mode m = minimize >
struct Optimizator {
public:
static const optimize_mode mode_ = m;
typedef optimize_mode optimize_mode_type;
// operator()
template<class T>
inline bool operator()(const T& t1, const T& t2) const
{ return mode_ == minimize ? t1<t2 : t2<t1; }
static double limit() {
return mode_ == minimize ? std::numeric_limits<double>::infinity()
: -std::numeric_limits<double>::infinity();
}
};
You can see that because of the template has a default value, the entire block now is not indented properly. After this point indentation is lost of course. Is there any way to make auto-indentation work for this type of cases? I've been playing with the settings but nothing will make my code indent properly. Any suggestions?
Thank you all,