WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 147142
129235
Use variadic templates to reduce the line count of wtf/text/StringConcatenate.h
https://bugs.webkit.org/show_bug.cgi?id=129235
Summary
Use variadic templates to reduce the line count of wtf/text/StringConcatenate.h
Sam Weinig
Reported
2014-02-23 12:56:35 PST
Use variadic templates to reduce the line count of wtf/text/StringConcatenate.h
Attachments
Patch
(33.72 KB, patch)
2014-02-23 12:59 PST
,
Sam Weinig
no flags
Details
Formatted Diff
Diff
Just the new code
(3.67 KB, text/plain)
2014-02-23 13:01 PST
,
Sam Weinig
no flags
Details
Patch
(26.19 KB, patch)
2014-02-28 20:06 PST
,
Sam Weinig
joepeck
: review-
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Sam Weinig
Comment 1
2014-02-23 12:59:00 PST
Created
attachment 225012
[details]
Patch
WebKit Commit Bot
Comment 2
2014-02-23 13:00:49 PST
Attachment 225012
[details]
did not pass style-queue: ERROR: Source/WTF/wtf/text/StringConcatenate.h:518: Do not use 'using namespace TryMakeStringDetails;'. [build/using_namespace] [4] Total errors found: 1 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Sam Weinig
Comment 3
2014-02-23 13:01:28 PST
Created
attachment 225013
[details]
Just the new code Adding a file with just new code, as the diff is a bit hard to read.
Sam Weinig
Comment 4
2014-02-23 13:02:49 PST
(In reply to
comment #2
)
>
Attachment 225012
[details]
did not pass style-queue: > > > ERROR: Source/WTF/wtf/text/StringConcatenate.h:518: Do not use 'using namespace TryMakeStringDetails;'. [build/using_namespace] [4]
I don't think this should be an error. The using namespace declaration is used inside a function.
Sam Weinig
Comment 5
2014-02-28 20:06:04 PST
Created
attachment 225523
[details]
Patch
Brent Fulgham
Comment 6
2014-04-16 14:03:19 PDT
This doesn't seem to work on Windows. Sometimes we run into problems with char*/wchar_t* Example error: WebSocketFrame.cpp 1>C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\include\private\wtf/text/StringConcatenate.h(521): error C2079: 'adaptedStrings' uses undefined class 'std::tuple<WTF::StringTypeAdapter<StringType1>,WTF::StringTypeAdapter<const char*>>' with [ StringType1=WTF::StringAppend<const char *,WTF::String> ] (..\Modules\websockets\WebSocketFrame.cpp) C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\include\private\wtf/text/StringOperators.h(38) : see reference to function template instantiation 'WTF::PassRefPtr<WTF::StringImpl> WTF::tryMakeString<StringType1,StringType2>(StringType1,StringType2)' being compiled with [ StringType1=WTF::StringAppend<const char *,WTF::String> , StringType2=const char * ] C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\include\private\wtf/text/StringOperators.h(37) : while compiling class template member function 'WTF::StringAppend<WTF::StringAppend<const char *,WTF::String>,const char *>::operator WTF::String(void) const' ..\Modules\websockets\WebSocketFrame.cpp(99) : see reference to function template instantiation 'WTF::StringAppend<WTF::StringAppend<const char *,WTF::String>,const char *>::operator WTF::String(void) const' being compiled ..\Modules\websockets\WebSocketFrame.cpp(99) : see reference to class template instantiation 'WTF::StringAppend<WTF::StringAppend<const char *,WTF::String>,const char *>' being compiled 1>C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\include\private\wtf/text/StringConcatenate.h(521): error C2078: too many initializers (..\Modules\websockets\WebSocketFrame.cpp) 1>C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\include\private\wtf/text/StringConcatenate.h(521): error C2440: 'initializing' : cannot convert from 'const char *' to 'int' (..\Modules\websockets\WebSocketFrame.cpp) There is no context in which this conversion is possible 1>C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\include\private\wtf/text/StringConcatenate.h(522): error C2783: 'WTF::PassRefPtr<WTF::StringImpl> WTF::TryMakeStringDetails::tryMakeStringTuple(Tuple)' : could not deduce template argument for 'Indicies' (..\Modules\websockets\WebSocketFrame.cpp) C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\include\private\wtf/text/StringConcatenate.h(509) : see declaration of 'WTF::TryMakeStringDetails::tryMakeStringTuple' 1>C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\include\private\wtf/text/StringConcatenate.h(522): error C2780: 'WTF::PassRefPtr<WTF::StringImpl> WTF::TryMakeStringDetails::tryMakeStringTuple(Tuple &&,std::index_sequence<Index...>)' : expects 2 arguments - 1 provided (..\Modules\websockets\WebSocketFrame.cpp) C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\include\private\wtf/text/StringConcatenate.h(503) : see declaration of 'WTF::TryMakeStringDetails::tryMakeStringTuple'
Mark Rowe (bdash)
Comment 7
2014-06-30 20:20:07 PDT
I wrote up a very similar patch this evening since I wasn't aware of this one. I don't think it's necessary to use std::tuple for this.
Joseph Pecoraro
Comment 8
2016-03-13 18:47:48 PDT
Comment on
attachment 225523
[details]
Patch This patch doesn't apply anymore, but it looks like it would be useful. Put up a rebaselined patch!
Brent Fulgham
Comment 9
2016-05-18 20:57:06 PDT
(In reply to
comment #8
)
> Comment on
attachment 225523
[details]
> Patch > > This patch doesn't apply anymore, but it looks like it would be useful. Put > up a rebaselined patch!
+1! And I think our Windows builds can handle this now...
Sam Weinig
Comment 10
2016-12-15 16:22:31 PST
*** This bug has been marked as a duplicate of
bug 147142
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug