diff --git a/changelog.md b/changelog.md
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,4 @@
+- 0.9.1.7: Allow arbitrary number of C++ templates, see PR #141.
 - 0.9.1.6: Fix mistakenly unsafe call, see issue #137.
 - 0.9.1.5: Support multi-token types in C++ template arguments, see issue #125 and PR #126.
 - 0.9.1.4: Support GHC 8.10, including better C++ flags handling, see PR #121.
diff --git a/inline-c.cabal b/inline-c.cabal
--- a/inline-c.cabal
+++ b/inline-c.cabal
@@ -1,5 +1,5 @@
 name:                inline-c
-version:             0.9.1.6
+version:             0.9.1.7
 synopsis:            Write Haskell source files including C code inline. No FFI required.
 description:         See <https://github.com/fpco/inline-c/blob/master/README.md>.
 license:             MIT
diff --git a/src/Language/C/Inline/Context.hs b/src/Language/C/Inline/Context.hs
--- a/src/Language/C/Inline/Context.hs
+++ b/src/Language/C/Inline/Context.hs
@@ -284,18 +284,12 @@
           Just ty -> return ty
         hsTy <- forM cTys $ \cTys'  -> go (C.TypeSpecifier undefined cTys')
         case hsTy of
-          (a:[]) ->
-            lift [t| $(symbol) $(return a) |]
-          (a:b:[]) ->
-            lift [t| $(symbol) '($(return a),$(return b))|]
-          (a:b:c:[]) ->
-            lift [t| $(symbol) '($(return a),$(return b),$(return c))|]
-          (a:b:c:d:[]) ->
-            lift [t| $(symbol) '($(return a),$(return b),$(return c),$(return d))|]
-          (a:b:c:d:e:[]) ->
-            lift [t| $(symbol) '($(return a),$(return b),$(return c),$(return d),$(return e))|]
           [] -> fail $ "Can not find template parameters."
-          _ -> fail $ "Find too many template parameters. num = " ++ show (length hsTy)
+          (a:[]) ->
+            lift $ TH.AppT <$> symbol <*> return a
+          other ->
+            let tuple = foldl (\tuple arg -> TH.AppT tuple arg) (TH.PromotedTupleT (length other)) other
+            in lift $ TH.AppT <$> symbol <*> return tuple
       C.TypeSpecifier _specs (C.TemplateConst num) -> do
         let n = (TH.LitT (TH.NumTyLit (read num)))
         lift [t| $(return n) |]
