Revision: | 1.1 |
Committed: | Sun Oct 17 08:14:45 2010 UTC (13 years, 8 months ago) by sf-pippijn |
Content type: | text/plain |
Branch: | MAIN |
CVS Tags: | HEAD |
Log Message: | initial import |
# | Content |
---|---|
1 | #pragma once |
2 | |
3 | #include <cstring> |
4 | #include <string> |
5 | |
6 | template<size_t N> |
7 | static int |
8 | strncmp (std::string const &s1, char const (&s2)[N]) |
9 | { |
10 | return s1.compare (0, N - 1, s2); |
11 | } |
12 | |
13 | template<size_t N> |
14 | static int |
15 | strncmp (char const *s1, char const (&s2)[N]) |
16 | { |
17 | return strncmp (s1, s2, N - 1); |
18 | } |