Код: Выделить всё
class RangeConverter {
private:
struct Converter {
double MinimumInput;
double MaximumInput;
double MinimumOutput;
double MaximumOutput;
template
RangeType Convert ( RangeType invalue ) const {
double v = static_cast ( invalue );
if ( v < MinimumInput ) {
v = MinimumInput;
} else if ( v > MaximumInput ) {
v = MaximumInput;
}
double interpolationfactor = ( v - MinimumInput ) / ( MaximumInput - MinimumInput );
return static_cast ( ( interpolationfactor * ( MaximumOutput - MinimumOutput ) ) + MinimumOutput );
}
};
.....
Код: Выделить всё
class RangeConverter {
private:
struct Converter {
ngeConverter {
private:
struct Converter {
double MinimumInput;
double MaximumInput;
double MinimumOutput;
double MaximumOutput;
template
RangeType Convert ( RangeType invalue ) const {
double v = static_cast ( invalue );
if ( v < MinimumInput ) {
v = MinimumInput;
} else if ( v > MaximumInput ) {
v = MaximumInput;
}
double interpolationfactor = ( v - MinimumInput ) / ( MaximumInput - MinimumInput );
return static_cast ( ( interpolationfactor * ( MaximumOutput - MinimumOutput ) ) + MinimumOutput );
}
};
.....
Код: Выделить всё
astyle
\ --style=java
\ --indent=force-tab=2
\ --indent-classes
\ --indent-switches
\ --indent-labels
\ --indent-preprocessor
\ --indent-col1-comments
\ --pad-oper
\ --pad-paren
\ --delete-empty-lines
\ --add-brackets
\ --align-pointer=type
\ --align-reference=type
Если это ошибка, что вы можете предложить для форматирования кода C++ с помощью VIM?< /п>
Подробнее здесь: https://stackoverflow.com/questions/123 ... formatting
Мобильная версия