[llvm-commits] [llvm] r87058 - in /llvm/trunk: include/llvm/ADT/StringRef.h lib/Support/StringExtras.cpp unittests/ADT/StringRefTest.cpp

Sebastian Redl sebastian.redl at getdesigned.at
Thu Nov 12 23:25:51 PST 2009


Rafael Espindola wrote:
> Author: rafael
> Date: Thu Nov 12 19:24:40 2009
> New Revision: 87058
>
> URL: http://llvm.org/viewvc/llvm-project?rev=87058&view=rev
> Log:
> Add a new split method to StringRef that puts the substrings in a vector.
>
>
> ==============================================================================
> --- llvm/trunk/include/llvm/ADT/StringRef.h (original)
> +++ llvm/trunk/include/llvm/ADT/StringRef.h Thu Nov 12 19:24:40 2009
> @@ -15,6 +15,14 @@
>  #include <cstring>
>  #include <string>
>  
> +namespace std {
> + template<typename _Tp>
> + class allocator;
> +
> + template<typename _Tp, typename _Alloc>
> + class vector;
> +}
> +
>   
You can't do that. Any standard library is allowed to declare its 
templates with any number of parameters, as long as all those that are 
not described in the standard have defaults. So this is not portable. 
Even if it was, you're still not allowed to forward-declare elements of 
the standard library yourself.
(As a side note, std::allocator is given to you by <string> anyway.)

Sebastian



More information about the llvm-commits mailing list