• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
C++ auto-indentation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C++ auto-indentation


  • Subject: C++ auto-indentation
  • From: Alejandro Aragon <email@hidden>
  • Date: Thu, 25 Jun 2009 15:43:41 -0500

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,


Alejandro M. Aragón
Ph.D. candidate in Civil Engineering
322 Talbot Laboratory
University of Illinois
104 S. Wright St, Urbana, Illinois, 61801
phone: +1 (217) 333-4434
https://netfiles.uiuc.edu/aaragon2/www

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: MPI and/or other compilers inside Xcode
  • Next by Date: Add a tool target, add an executable?
  • Previous by thread: MPI and/or other compilers inside Xcode
  • Next by thread: Add a tool target, add an executable?
  • Index(es):
    • Date
    • Thread