[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Not properly indenting
From: |
Eric Deplagne |
Subject: |
Re: Not properly indenting |
Date: |
Sun, 21 Aug 2016 16:15:11 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Hi,
Answer to that is so Canonical I can give it right away: GNU indent is for
indenting C code, *not* C++.
On Sun, 21 Aug 2016 05:58:30 -0700, tima redoc wrote:
> I have a c++ file and I tried various options including -kr and others, but
> this is not getting properly indented.
>
> Any help will be appreciated!
> #include <vector>
> #include <list>
> #include <map>
> #include <set>
> #include <deque>
> #include <queue>
> #include <stack>
> #include <bitset>
> #include <algorithm>
> #include <functional>
> #include <numeric>
> #include <utility>
> #include <sstream>
> #include <iostream>
> #include <iomanip>
> #include <cstdio>
> #include <cmath>
> #include <cstdlib>
> #include <cctype>
> #include <string>
> #include <cstring>
> #include <cstdio>
> #include <cmath>
> #include <cstdlib>
> #include <ctime>
> #include <string.h>
> #include <fstream>
> #include <cassert>
> #include <ext/pb_ds/assoc_container.hpp>
> #include <ext/pb_ds/tree_policy.hpp>
> //#include <sys/resource.h>
> using namespace std;
>
using namespace __gnu_pbds;
>
> #define mod 1000000007
>
typedef tree < int, null_type, less < int >, rb_tree_tag,
> tree_order_statistics_node_update > ordered_set;
>
typedef long long ll;
>
typedef vector < int >vi;
>
typedef vector < ll > vl;
>
typedef vector < vector < int >>vvi;
>
typedef vector < vector < ll > >vvl;
>
typedef pair < int, int >pii;
>
typedef pair < ll, ll > pll;
>
typedef vector < pair < int, int >>vpii;
>
typedef vector < pair < ll, ll >> vpll;
>
typedef vector < vector < pair < int, int >>>vvpii;
>
typedef vector < vector < pair < ll, ll >>> vvpll;
>
template < typename T, typename U > static void
> amin (T & x, U y)
> {
> if (y < x)
> x = y;
> }
>
>
template < typename T, typename U > static void
> amax (T & x, U y)
> {
> if (x < y)
> x = y;
> }
>
>
> #ifdef amit
> template < class T, class U >
ostream & operator<< (ostream & out,
> const pair < T, U > &a)
> {
> out << "[" << a.first << " " << a.second << "]";
> return out;
> }
>
>
template < class T >
ostream & operator<< (ostream & out,
> const vector < T > &a)
> {
> out << "[ ";
> for (auto & it:a)
> out << it << " ";
> out << "]";
> return out;
> }
>
>
template < class T >
ostream & operator<< (ostream & out,
> const set < T > &a)
> {
> out << "[ ";
> for (auto & it:a)
> out << it << " ";
> out << "]";
> return out;
> }
>
>
template < class T >
ostream & operator<< (ostream & out,
> const multiset < T > &a)
> {
> out << "[ ";
> for (auto & it:a)
> out << it << " ";
> out << "]";
> return out;
> }
>
>
template < class T, class U >
ostream & operator<< (ostream & out,
> const map < T, U > &a)
> {
> for (auto & it:a)
> out << it.first << " -> " << it.second << " | ";
> return out;
> }
>
>
template < class T, class U >
ostream & operator<< (ostream & out,
> const multimap < T,
> U > &a)
> {
> for (auto & it:a)
> out << it.first << " -> " << it.second << " | ";
> return out;
> }
>
>
> #define pra(a,n) cerr<<#a<<" : ";for(int i=0;i<=n;++i)cerr<<a[i]<<"
> ";cerr<<endl;
> #define praa(a,n,m) cerr<<#a<<" : "<<endl;for(int i=0;i<=n;++i){for(int
> j=0;j<=m;++j)cerr<<a[i][j]<<" ";cerr<<endl;}
> #define pr(...) __f(#__VA_ARGS__, __VA_ARGS__)
> #define prl() cerr<<__LINE__ << ": "<<__PRETTY_FUNCTION__<<endl;
> template < typename Arg1 >
void
> __f (const char *name, Arg1 && arg1)
> {
>
cerr << name << " : " << arg1 << std::endl;
>
}
template < typename Arg1, typename ... Args >
void
>
> __f (const char *names, Arg1 && arg1, Args && ... args)
> {
>
const char *comma = strchr (names + 1, ',');
> cerr.write (names, comma - names) << " : " << arg1 << " | ";
> __f (comma + 1, args ...);
>
}
>
> #define gc getchar
> #else
> #define pr(...)
> #define pra(a,n)
> #define praa(a,n,m)
> #define prl()
> #define gc getchar
> #endif
>
> #define inc_stack_limit const rlim_t kStackSize = 64 * 1024 * 1024;struct
> rlimit rl;rl.rlim_cur = kStackSize;setrlimit(RLIMIT_STACK, &rl);
> #define sz(a) int((a).size())
> #define all(a) (a).begin(),(a).end()
> #define boost ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
> #define pb push_back
> #define eb emplace_back
> #define mp make_pair
> #define F first
> #define S second
> #define rep(i,s,n) for(int i=s;i<=(n);++i)
> #define rev(i,n,s) for(int i=(n);i>=s;--i)
> #define fore(x,a) for(auto&& x: a)
> #define fill(a,x) memset((a),(x),sizeof(a))
> const double eps = 1e-6;
>
> #define tcase int __T;cin>>__T;rep(Tc,1,__T)
> #define ass(n,l,r) assert(n>=l and n<=r)
> #define endl '\n'
> inline int
> add (int a, int b, int m = mod)
> {
> a += b;
> if (a >= m)
> a -= m;
> return a;
> }
>
>
inline int
> mul (int a, int b, int m = mod)
> {
> return (int) (((ll) a * (ll) b) % m);
> }
inline int
>
> ri ()
> {
>
> int c = gc ();
> int ret = 0;
> while (c < '0' || c > '9')
> c = gc ();
> while (c >= '0' && c <= '9')
> {
> ret = 10 * ret + c - 48;
> c = gc ();
> }
> return ret;
> }
>
>
> #define N 100005
>
int
> main ()
> {
>
boost;
> rep (i, 0, 5)
> {
>
cout << i << endl;
>
}
return 0;
>
}
> _______________________________________________
> bug-indent mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/bug-indent
--
Eric Deplagne
signature.asc
Description: Digital signature