Skip to content

Commit

Permalink
Add in warning for VS2012 compile errors
Browse files Browse the repository at this point in the history
This is to do with the maximum tuple size.

http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx
  • Loading branch information
Edward Rosten committed Aug 13, 2013
1 parent 6b87649 commit 5695732
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
24 changes: 20 additions & 4 deletions doc/tag.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ Why use this library ?
@section sDownload Getting the code and installing
To get the code from cvs use:
To get the code from use:
@code
cvs -z3 -d:pserver:[email protected]:/cvsroot/toon co tag
git clone git://github.com/edrosten/tag.git
@endcode
@subsection unix Unix
Expand All @@ -52,8 +52,24 @@ library and binary files (for DLLs).
- @c LIBDIR contains library files. tag static libraries (debug and release verions) will be copied into @c \%LIBDIR\%
- @c BINDIR is not used for tag, but would be the default directory for DLLs
@subsubsection vs2012 Visual Studio 2012
By default the compile fails on VS 2012. This is because visual studio does not yet
support variadic templates but simulates them with multiply included headers. The maximum
depth for templates has been reduced from 10 to 5 in VS 2012.
To correct, you need to set the macro <code>_VARIADIC_MAX</code> to 10.
This is covered in more detail here:
http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx
@section sLinks Links
- TooN - http://mi.eng.cam.ac.uk/~twd20/TooN/html/index.html
- CVS web interface - http://cvs.savannah.gnu.org/viewvc/tag/?root=toon
- TooN - http://www.edwardrosten.com/cvd/toon.html
*/
10 changes: 10 additions & 0 deletions src/polynomial.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ inline bool signbit( const double & d ){
}
#endif

//Check for VisualStudio and variadic template hacks.

#ifdef _MSC_VER
#if _VARIADIC_MAX < 10
#error Visual Studio does not yet support variadic templates properly. Please define _VARIADIC_MAX project wide to 10
#error Visit http:/blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx for more information.
#endif
#endif


template<int AN, int BN> Vector<AN+BN-1> poly_mul(const Vector<AN>& a, const Vector<BN>& b)
{
//Polynomials are stored with the coefficient of zero in the first
Expand Down

0 comments on commit 5695732

Please sign in to comment.