<!DOCTYPE html>

<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="mobile-web-app-capable" content="yes">
    <title>
        Multi-argument constrained-parameter - HackMD
    </title>
    <link rel="icon" type="image/png" href="https://hackmd.io/favicon.png">
    <link rel="apple-touch-icon" href="https://hackmd.io/apple-touch-icon.png">

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css" integrity="sha256-3iu9jgsy9TpTwXKb7bNQzqWekRX7pPK+2OLj3R922fo=" crossorigin="anonymous" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/octicons/3.5.0/octicons.min.css" integrity="sha256-QiWfLIsCT02Sdwkogf6YMiQlj4NE84MKkzEMkZnMGdg=" crossorigin="anonymous" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.1/themes/prism.min.css" integrity="sha256-vtR0hSWRc3Tb26iuN2oZHt3KRUomwTufNIf5/4oeCyg=" crossorigin="anonymous" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/css/basic/emojify.min.css" integrity="sha256-UOrvMOsSDSrW6szVLe8ZDZezBxh5IoIfgTwdNDgTjiU=" crossorigin="anonymous" />
    <style>
        @import url(https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i|Source+Code+Pro:300,400,500|Source+Sans+Pro:300,300i,400,400i,600,600i|Source+Serif+Pro&subset=latin-ext);.hljs{display:block;background:#fff;padding:.5em;color:#333;overflow-x:auto}.hljs-comment,.hljs-meta{color:#969896}.hljs-emphasis,.hljs-quote,.hljs-string,.hljs-strong,.hljs-template-variable,.hljs-variable{color:#df5000}.hljs-keyword,.hljs-selector-tag,.hljs-type{color:#a71d5d}.hljs-attribute,.hljs-bullet,.hljs-literal,.hljs-number,.hljs-symbol{color:#0086b3}.hljs-built_in,.hljs-builtin-name{color:#005cc5}.hljs-name,.hljs-section{color:#63a35c}.hljs-tag{color:#333}.hljs-attr,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-title{color:#795da3}.hljs-addition{color:#55a532;background-color:#eaffea}.hljs-deletion{color:#bd2c00;background-color:#ffecec}.hljs-link{text-decoration:underline}.markdown-body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:16px;line-height:1.5;word-wrap:break-word}.markdown-body:after,.markdown-body:before{display:table;content:""}.markdown-body:after{clear:both}.markdown-body>:first-child{margin-top:0!important}.markdown-body>:last-child{margin-bottom:0!important}.markdown-body a:not([href]){color:inherit;text-decoration:none}.markdown-body .absent{color:#c00}.markdown-body .anchor{float:left;padding-right:4px;margin-left:-20px;line-height:1}.markdown-body .anchor:focus{outline:none}.markdown-body blockquote,.markdown-body dl,.markdown-body ol,.markdown-body p,.markdown-body pre,.markdown-body table,.markdown-body ul{margin-top:0;margin-bottom:16px}.markdown-body hr{height:.25em;padding:0;margin:24px 0;background-color:#e7e7e7;border:0}.markdown-body blockquote{font-size:16px;padding:0 1em;color:#777;border-left:.25em solid #ddd}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body .loweralpha{list-style-type:lower-alpha}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{margin-top:24px;margin-bottom:16px;font-weight:600;line-height:1.25}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{color:#000;vertical-align:middle;visibility:hidden}.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{text-decoration:none}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{visibility:visible}.markdown-body h1 code,.markdown-body h1 tt,.markdown-body h2 code,.markdown-body h2 tt,.markdown-body h3 code,.markdown-body h3 tt,.markdown-body h4 code,.markdown-body h4 tt,.markdown-body h5 code,.markdown-body h5 tt,.markdown-body h6 code,.markdown-body h6 tt{font-size:inherit}.markdown-body h1{font-size:2em}.markdown-body h1,.markdown-body h2{padding-bottom:.3em;border-bottom:1px solid #eee}.markdown-body h2{font-size:1.5em}.markdown-body h3{font-size:1.25em}.markdown-body h4{font-size:1em}.markdown-body h5{font-size:.875em}.markdown-body h6{font-size:.85em;color:#777}.markdown-body ol,.markdown-body ul{padding-left:2em}.markdown-body ol.no-list,.markdown-body ul.no-list{padding:0;list-style-type:none}.markdown-body ol ol,.markdown-body ol ul,.markdown-body ul ol,.markdown-body ul ul{margin-top:0;margin-bottom:0}.markdown-body li>p{margin-top:16px}.markdown-body li+li{margin-top:.25em}.markdown-body dl{padding:0}.markdown-body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:700}.markdown-body dl dd{padding:0 16px;margin-bottom:16px}.markdown-body table{display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}.markdown-body table th{font-weight:700}.markdown-body table td,.markdown-body table th{padding:6px 13px;border:1px solid #ddd}.markdown-body table tr{background-color:#fff;border-top:1px solid #ccc}.markdown-body table tr:nth-child(2n){background-color:#f8f8f8}.markdown-body img{max-width:100%;box-sizing:content-box;background-color:#fff}.markdown-body img[align=right]{padding-left:20px}.markdown-body img[align=left]{padding-right:20px}.markdown-body .emoji{max-width:none;vertical-align:text-top;background-color:transparent}.markdown-body span.frame{display:block;overflow:hidden}.markdown-body span.frame>span{display:block;float:left;width:auto;padding:7px;margin:13px 0 0;overflow:hidden;border:1px solid #ddd}.markdown-body span.frame span img{display:block;float:left}.markdown-body span.frame span span{display:block;padding:5px 0 0;clear:both;color:#333}.markdown-body span.align-center{display:block;overflow:hidden;clear:both}.markdown-body span.align-center>span{display:block;margin:13px auto 0;overflow:hidden;text-align:center}.markdown-body span.align-center span img{margin:0 auto;text-align:center}.markdown-body span.align-right{display:block;overflow:hidden;clear:both}.markdown-body span.align-right>span{display:block;margin:13px 0 0;overflow:hidden;text-align:right}.markdown-body span.align-right span img{margin:0;text-align:right}.markdown-body span.float-left{display:block;float:left;margin-right:13px;overflow:hidden}.markdown-body span.float-left span{margin:13px 0 0}.markdown-body span.float-right{display:block;float:right;margin-left:13px;overflow:hidden}.markdown-body span.float-right>span{display:block;margin:13px auto 0;overflow:hidden;text-align:right}.markdown-body code,.markdown-body tt{padding:0;padding-top:.2em;padding-bottom:.2em;margin:0;font-size:85%;background-color:rgba(0,0,0,.04);border-radius:3px}.markdown-body code:after,.markdown-body code:before,.markdown-body tt:after,.markdown-body tt:before{letter-spacing:-.2em;content:"\00a0"}.markdown-body code br,.markdown-body tt br{display:none}.markdown-body del code{text-decoration:inherit}.markdown-body pre{word-wrap:normal}.markdown-body pre>code{padding:0;margin:0;font-size:100%;word-break:normal;white-space:pre;background:transparent;border:0}.markdown-body .highlight{margin-bottom:16px}.markdown-body .highlight pre{margin-bottom:0;word-break:normal}.markdown-body .highlight pre,.markdown-body pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f7f7f7;border-radius:3px}.markdown-body pre code,.markdown-body pre tt{display:inline;max-width:auto;padding:0;margin:0;overflow:visible;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}.markdown-body pre code:after,.markdown-body pre code:before,.markdown-body pre tt:after,.markdown-body pre tt:before{content:normal}.markdown-body .csv-data td,.markdown-body .csv-data th{padding:5px;overflow:hidden;font-size:12px;line-height:1;text-align:left;white-space:nowrap}.markdown-body .csv-data .blob-line-num{padding:10px 8px 9px;text-align:right;background:#fff;border:0}.markdown-body .csv-data tr{border-top:0}.markdown-body .csv-data th{font-weight:700;background:#f8f8f8;border-top:0}.markdown-body kbd{display:inline-block;padding:3px 5px;font-size:11px;line-height:10px;color:#555;vertical-align:middle;background-color:#fcfcfc;border:1px solid #ccc;border-bottom-color:#bbb;border-radius:3px;box-shadow:inset 0 -1px 0 #bbb}.news .alert .markdown-body blockquote{padding:0 0 0 40px;border:0 none}.activity-tab .news .alert .commits,.activity-tab .news .markdown-body blockquote{padding-left:0}.task-list-item{list-style-type:none}.task-list-item label{font-weight:400}.task-list-item.enabled label{cursor:pointer}.task-list-item+.task-list-item{margin-top:3px}.task-list-item-checkbox{float:left;margin:.31em 0 .2em -1.3em!important;vertical-align:middle;cursor:default!important}.markdown-body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Helvetica,Arial,sans-serif;padding-top:40px;padding-bottom:40px;max-width:758px;overflow:visible!important}.markdown-body .emoji{vertical-align:top}.markdown-body pre{border:inherit!important}.markdown-body code{color:inherit!important}.markdown-body pre code .wrapper{display:-moz-inline-flex;display:-ms-inline-flex;display:-o-inline-flex;display:inline-flex}.markdown-body pre code .gutter{float:left;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.markdown-body pre code .gutter.linenumber{text-align:right;position:relative;display:inline-block;cursor:default;z-index:4;padding:0 8px 0 0;min-width:20px;box-sizing:content-box;color:#afafaf!important;border-right:3px solid #6ce26c!important}.markdown-body pre code .gutter.linenumber>span:before{content:attr(data-linenumber)}.markdown-body pre code .code{float:left;margin:0 0 0 16px}.markdown-body .gist .line-numbers{border-left:none;border-top:none;border-bottom:none}.markdown-body .gist .line-data{border:none}.markdown-body .gist table{border-spacing:0;border-collapse:inherit!important}.markdown-body code[data-gist-id]{background:none;padding:0}.markdown-body code[data-gist-id]:after,.markdown-body code[data-gist-id]:before{content:""}.markdown-body code[data-gist-id] .blob-num{border:unset}.markdown-body code[data-gist-id] table{overflow:unset;margin-bottom:unset}.markdown-body code[data-gist-id] table tr{background:unset}.markdown-body[dir=rtl] pre{direction:ltr}.markdown-body[dir=rtl] code{direction:ltr;unicode-bidi:embed}.markdown-body .alert>p{margin-bottom:0}.markdown-body pre.abc,.markdown-body pre.flow-chart,.markdown-body pre.graphviz,.markdown-body pre.mermaid,.markdown-body pre.sequence-diagram{text-align:center;background-color:inherit;border-radius:0;white-space:inherit}.markdown-body pre.abc>code,.markdown-body pre.flow-chart>code,.markdown-body pre.graphviz>code,.markdown-body pre.mermaid>code,.markdown-body pre.sequence-diagram>code{text-align:left}.markdown-body pre.abc>svg,.markdown-body pre.flow-chart>svg,.markdown-body pre.graphviz>svg,.markdown-body pre.mermaid>svg,.markdown-body pre.sequence-diagram>svg{max-width:100%;height:100%}.markdown-body pre>code.wrap{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}.markdown-body .alert>p,.markdown-body .alert>ul{margin-bottom:0}.markdown-body summary{display:list-item}.markdown-body summary:focus{outline:none}.markdown-body details summary{cursor:pointer}.markdown-body details:not([open])>:not(summary){display:none}.markdown-body figure{margin:1em 40px}.markdown-body .mark,.markdown-body mark{background-color:#fff1a7}.vimeo,.youtube{cursor:pointer;display:table;text-align:center;background-position:50%;background-repeat:no-repeat;background-size:contain;background-color:#000;overflow:hidden}.vimeo,.youtube{position:relative;width:100%}.youtube{padding-bottom:56.25%}.vimeo img{width:100%;-o-object-fit:contain;object-fit:contain;z-index:0}.youtube img{-o-object-fit:cover;object-fit:cover;z-index:0}.vimeo iframe,.youtube iframe,.youtube img{width:100%;height:100%;position:absolute;top:0;left:0}.vimeo iframe,.youtube iframe{vertical-align:middle;z-index:1}.vimeo .icon,.youtube .icon{position:absolute;height:auto;width:auto;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#fff;opacity:.3;transition:opacity .2s;z-index:0}.vimeo:hover .icon,.youtube:hover .icon{opacity:.6;transition:opacity .2s}.slideshare .inner,.speakerdeck .inner{position:relative;width:100%}.slideshare .inner iframe,.speakerdeck .inner iframe{position:absolute;top:0;bottom:0;left:0;right:0;width:100%;height:100%}.MJX_Assistive_MathML{display:none}.ui-infobar{position:relative;z-index:2;max-width:758px;margin-top:25px;margin-bottom:-25px;color:#777}.ui-toc{position:fixed;bottom:20px;z-index:10000}.ui-toc-label{opacity:.3;background-color:#ccc;border:none;transition:opacity .2s}.ui-toc .open .ui-toc-label{opacity:1;color:#fff;transition:opacity .2s}.ui-toc-label:focus{opacity:.3;background-color:#ccc;color:#000}.ui-toc-label:hover{opacity:1;background-color:#ccc;transition:opacity .2s}.ui-toc-dropdown{margin-top:23px;margin-bottom:20px;padding-left:10px;padding-right:10px;max-width:45vw;width:25vw;max-height:70vh;overflow:auto;text-align:inherit}.ui-toc-dropdown>.toc{max-height:calc(70vh - 100px);overflow:auto}.ui-toc-dropdown[dir=rtl] .nav{padding-right:0;letter-spacing:.0029em}.ui-toc-dropdown a{overflow:hidden;text-overflow:ellipsis;white-space:pre}.ui-toc-dropdown .nav>li>a{display:block;padding:4px 20px;font-size:13px;font-weight:500;color:#767676}.ui-toc-dropdown .nav>li:first-child:last-child > ul,.ui-toc-dropdown .toc.expand ul{display:block}.ui-toc-dropdown .nav>li>a:focus,.ui-toc-dropdown .nav>li>a:hover{padding-left:19px;color:#000;text-decoration:none;background-color:transparent;border-left:1px solid #000}.ui-toc-dropdown[dir=rtl] .nav>li>a:focus,.ui-toc-dropdown[dir=rtl] .nav>li>a:hover{padding-right:19px;border-left:none;border-right:1px solid #000}.ui-toc-dropdown .nav>.active:focus>a,.ui-toc-dropdown .nav>.active:hover>a,.ui-toc-dropdown .nav>.active>a{padding-left:18px;font-weight:700;color:#000;background-color:transparent;border-left:2px solid #000}.ui-toc-dropdown[dir=rtl] .nav>.active:focus>a,.ui-toc-dropdown[dir=rtl] .nav>.active:hover>a,.ui-toc-dropdown[dir=rtl] .nav>.active>a{padding-right:18px;border-left:none;border-right:2px solid #000}.ui-toc-dropdown .nav .nav{display:none;padding-bottom:10px}.ui-toc-dropdown .nav>.active>ul{display:block}.ui-toc-dropdown .nav .nav>li>a{padding-top:1px;padding-bottom:1px;padding-left:30px;font-size:12px;font-weight:400}.ui-toc-dropdown[dir=rtl] .nav .nav>li>a{padding-right:30px}.ui-toc-dropdown .nav .nav>li>ul>li>a{padding-top:1px;padding-bottom:1px;padding-left:40px;font-size:12px;font-weight:400}.ui-toc-dropdown[dir=rtl] .nav .nav>li>ul>li>a{padding-right:40px}.ui-toc-dropdown .nav .nav>li>a:focus,.ui-toc-dropdown .nav .nav>li>a:hover{padding-left:29px}.ui-toc-dropdown[dir=rtl] .nav .nav>li>a:focus,.ui-toc-dropdown[dir=rtl] .nav .nav>li>a:hover{padding-right:29px}.ui-toc-dropdown .nav .nav>li>ul>li>a:focus,.ui-toc-dropdown .nav .nav>li>ul>li>a:hover{padding-left:39px}.ui-toc-dropdown[dir=rtl] .nav .nav>li>ul>li>a:focus,.ui-toc-dropdown[dir=rtl] .nav .nav>li>ul>li>a:hover{padding-right:39px}.ui-toc-dropdown .nav .nav>.active:focus>a,.ui-toc-dropdown .nav .nav>.active:hover>a,.ui-toc-dropdown .nav .nav>.active>a{padding-left:28px;font-weight:500}.ui-toc-dropdown[dir=rtl] .nav .nav>.active:focus>a,.ui-toc-dropdown[dir=rtl] .nav .nav>.active:hover>a,.ui-toc-dropdown[dir=rtl] .nav .nav>.active>a{padding-right:28px}.ui-toc-dropdown .nav .nav>.active>.nav>.active:focus>a,.ui-toc-dropdown .nav .nav>.active>.nav>.active:hover>a,.ui-toc-dropdown .nav .nav>.active>.nav>.active>a{padding-left:38px;font-weight:500}.ui-toc-dropdown[dir=rtl] .nav .nav>.active>.nav>.active:focus>a,.ui-toc-dropdown[dir=rtl] .nav .nav>.active>.nav>.active:hover>a,.ui-toc-dropdown[dir=rtl] .nav .nav>.active>.nav>.active>a{padding-right:38px}.markdown-body[lang^=ja]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Helvetica,Arial,Hiragino Kaku Gothic Pro,ヒラギノ角ゴ Pro W3,Osaka,Meiryo,メイリオ,MS Gothic,ＭＳ\ ゴシック,sans-serif}.ui-toc-dropdown[lang^=ja]{font-family:Source Sans Pro,Helvetica,Arial,Meiryo UI,MS PGothic,ＭＳ\ Ｐゴシック,sans-serif}.markdown-body[lang=zh-tw]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Helvetica,Arial,PingFang TC,Microsoft JhengHei,微軟正黑,sans-serif}.ui-toc-dropdown[lang=zh-tw]{font-family:Source Sans Pro,Helvetica,Arial,Microsoft JhengHei UI,微軟正黑UI,sans-serif}.markdown-body[lang=zh-cn]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Helvetica,Arial,PingFang SC,Microsoft YaHei,微软雅黑,sans-serif}.ui-toc-dropdown[lang=zh-cn]{font-family:Source Sans Pro,Helvetica,Arial,Microsoft YaHei UI,微软雅黑UI,sans-serif}.ui-affix-toc{position:fixed;top:0;max-width:15vw;max-height:70vh;overflow:auto}.back-to-top,.expand-toggle,.go-to-bottom{display:block;padding:4px 10px;margin-top:10px;margin-left:10px;font-size:12px;font-weight:500;color:#999}.back-to-top:focus,.back-to-top:hover,.expand-toggle:focus,.expand-toggle:hover,.go-to-bottom:focus,.go-to-bottom:hover{color:#563d7c;text-decoration:none}.back-to-top,.go-to-bottom{margin-top:0}.ui-user-icon{width:20px;height:20px;display:block;border-radius:3px;margin-top:2px;margin-bottom:2px;margin-right:5px;background-position:50%;background-repeat:no-repeat;background-size:contain}.ui-user-icon.small{width:18px;height:18px;display:inline-block;vertical-align:middle;margin:0 0 .2em}.ui-infobar>small>span{line-height:22px}.ui-infobar>small .dropdown{display:inline-block}.ui-infobar>small .dropdown a:focus,.ui-infobar>small .dropdown a:hover{text-decoration:none}.unselectable{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;-ms-user-select:none;user-select:none}@media print{blockquote,div,img,pre,table{page-break-inside:avoid!important}a[href]:after{font-size:12px!important}}.markdown-body.slides{position:relative;z-index:1;color:#222}.markdown-body.slides:before{content:"";display:block;position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;background-color:currentColor;box-shadow:0 0 0 50vw}.markdown-body.slides section[data-markdown]{position:relative;margin-bottom:1.5em;background-color:#fff;text-align:center}.markdown-body.slides section[data-markdown] code{text-align:left}.markdown-body.slides section[data-markdown]:before{content:"";display:block;padding-bottom:56.23%}.markdown-body.slides section[data-markdown]>div:first-child{position:absolute;top:50%;left:1em;right:1em;-webkit-transform:translateY(-50%);transform:translateY(-50%);max-height:100%;overflow:hidden}.markdown-body.slides section[data-markdown]>ul{display:inline-block}.markdown-body.slides>section>section+section:after{content:"";position:absolute;top:-1.5em;right:1em;height:1.5em;border:3px solid #777}body{font-smoothing:subpixel-antialiased!important;-webkit-font-smoothing:subpixel-antialiased!important;-moz-osx-font-smoothing:auto!important;text-shadow:0 0 1em transparent,1px 1px 1.2px rgba(0,0,0,.004);-webkit-overflow-scrolling:touch;font-family:Source Sans Pro,Helvetica,Arial,sans-serif;letter-spacing:.025em}.focus,:focus{outline:none!important}::-moz-focus-inner{border:0!important}body.modal-open{overflow-y:auto;padding-right:0!important}
    </style>
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    	<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js" integrity="sha256-3Jy/GbSLrg0o9y5Z5n1uw0qxZECH7C6OQpVBgNFYa0g=" crossorigin="anonymous"></script>
    	<script src="https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js" integrity="sha256-g6iAfvZp+nDQ2TdTR/VVKJf3bGro4ub5fvWSWVRi2NE=" crossorigin="anonymous"></script>
		<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.9/es5-shim.min.js" integrity="sha256-8E4Is26QH0bD52WoQpcB+R/tcWQtpzlCojrybUd7Mxo=" crossorigin="anonymous"></script>
    <![endif]-->
</head>

<body>
    <div id="doc" class="markdown-body container-fluid"><style>
ins { color: #080 }
s { color: #F00 }
blockquote { color: inherit !important }
tbody code { background-color: inherit !important }
</style><table><tbody>
<tr><th>Doc. no.:</th>    <td>P1157R0</td></tr>
<tr><th>Date:</th>    <td>2018-07-14</td></tr>
<tr><th>Audience:</th>    <td>EWG</td></tr>
<tr><th>Reply-to:</th>    <td>Zhihao Yuan &lt;zy at miator dot net&gt;</td></tr>
</tbody></table><h1 id="Multi-argument-constrained-parameter" style=""><a class="anchor hidden-xs" href="#Multi-argument-constrained-parameter" title="Multi-argument-constrained-parameter"><span class="octicon octicon-link"></span></a>Multi-argument <em>constrained-parameter</em></h1><p><em>“[…] the multi-argument concept name introducer notion is the only fully general principled notation.”</em> <sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup></p><h2 id="Introduction" style=""><a class="anchor hidden-xs" href="#Introduction" title="Introduction"><span class="octicon octicon-link"></span></a>Introduction</h2><table>
<thead>
<tr>
<th>constrained upon introduced</th>
<th>unconstrained upon introduced</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>template&lt;EqualityComparable T&gt;</code><br><code>bool operator==(list&lt;T&gt;, list&lt;T&gt;);</code></td>
<td><code>template&lt;class T&gt;</code><br><code>requires EqualityComparable&lt;T&gt;</code><br><code>bool operator==(list&lt;T&gt;, list&lt;T&gt;);</code></td>
</tr>
<tr>
<td><span style="color: green"><code>template&lt;EqualityComparableWith T U&gt;</code><br><code>bool operator==(list&lt;T&gt;, list&lt;U&gt;);</code></span></td>
<td><code>template&lt;class T, class U&gt;</code><br><code>requires EqualityComparableWith&lt;T, U&gt;</code><br><code>bool operator==(list&lt;T&gt;, list&lt;U&gt;);</code></td>
</tr>
</tbody>
</table><h2 id="Motivation" style=""><a class="anchor hidden-xs" href="#Motivation" title="Motivation"><span class="octicon octicon-link"></span></a>Motivation</h2><p>The motivation of this proposal is to reduce the occurrence of unconstrained type parameters in generic library specifications.  Take the following signature for example,</p><pre><code class="c++ hljs"><span class="hljs-keyword">template</span>&lt;<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">T</span>, <span class="hljs-title">class</span> <span class="hljs-title">U</span>&gt;
<span class="hljs-title">requires</span> <span class="hljs-title">EqualityComparableWith</span>&lt;T, U&gt;
<span class="hljs-title">bool</span> <span class="hljs-title">operator</span>==(<span class="hljs-title">list</span>&lt;T&gt; <span class="hljs-title">const</span>&amp; <span class="hljs-title">x</span>, <span class="hljs-title">list</span>&lt;U&gt; <span class="hljs-title">const</span>&amp; <span class="hljs-title">y</span>);</span>
</code></pre><p>Here we introduced two type parameters unconstrained to constrain them later.   An alternative may introduce one:</p><pre><code class="c++ hljs"><span class="hljs-keyword">template</span>&lt;<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">T</span>, <span class="hljs-title">EqualityComparableWith</span>&lt;T&gt; <span class="hljs-title">U</span>&gt;
<span class="hljs-title">bool</span> <span class="hljs-title">operator</span>==(<span class="hljs-title">list</span>&lt;T&gt; <span class="hljs-title">const</span>&amp; <span class="hljs-title">x</span>, <span class="hljs-title">list</span>&lt;U&gt; <span class="hljs-title">const</span>&amp; <span class="hljs-title">y</span>);</span>
</code></pre><p>But if the designated concept takes only one argument, with <em>constrained-parameter</em> we don’t have to have any unconstrained parameter:</p><pre><code class="c++ hljs"><span class="hljs-keyword">template</span>&lt;EqualityComparable T&gt;
<span class="hljs-keyword">bool</span> <span class="hljs-keyword">operator</span>==(<span class="hljs-built_in">list</span>&lt;T&gt; <span class="hljs-keyword">const</span>&amp; x, <span class="hljs-built_in">list</span>&lt;T&gt; <span class="hljs-keyword">const</span>&amp; y);
</code></pre><p>The author believes that it is worth to extend this functionality to apply to the concepts that take more than one arguments:</p><pre><code class="c++ hljs"><span class="hljs-keyword">template</span>&lt;EqualityComparableWith T U&gt;
<span class="hljs-keyword">bool</span> <span class="hljs-keyword">operator</span>==(<span class="hljs-built_in">list</span>&lt;T&gt; <span class="hljs-keyword">const</span>&amp; x, <span class="hljs-built_in">list</span>&lt;U&gt; <span class="hljs-keyword">const</span>&amp; y);
</code></pre><p>One might consider this to be a minor issue by claiming that multi-parameter type concepts are “rare” or “complex<sup class="footnote-ref"><a href="#fn2" id="fnref2">[2]</a></sup>.”  The rest of this section shows that these are misconceptions.</p><h3 id="Multi-parameter-type-concepts-are-not-uncommon" style=""><a class="anchor hidden-xs" href="#Multi-parameter-type-concepts-are-not-uncommon" title="Multi-parameter-type-concepts-are-not-uncommon"><span class="octicon octicon-link"></span></a>Multi-parameter type concepts are not uncommon</h3><p>A survey on the future concepts library<sup class="footnote-ref"><a href="#fn3" id="fnref3">[3]</a></sup> and ranges library<sup class="footnote-ref"><a href="#fn4" id="fnref4">[4]</a></sup> shows that 47% percent of the concepts specified in the next standard can take multiple arguments:</p><table>
<thead>
<tr>
<th>&nbsp;</th>
<th>takes only one argument</th>
<th>may take multiple arguments</th>
</tr>
</thead>
<tbody>
<tr>
<td>Standard Library Concepts</td>
<td>Integral<br>SignedIntegral<br>UnsignedIntegral<br>Swappable<br>Destructible<br>DefaultConstructible<br>MoveConstructible<br>CopyConstructible<br>Boolean<br>EqualityComparable<br>StrictTotallyOrdered<br>Movable<br>Copyable<br>Semiregular<br>Regular<br></td>
<td>Same<br>DerivedFrom<br>ConvertibleTo<br>CommonReference<br>Common<br>Assignable<br>SwappableWith<br>Constructible<br>EqualityComparableWith<br>StrictTotallyOrderedWith<br>Invocable<br>RegularInvocable<br>Predicate<br>Relation<br>StrictWeakOrder<br></td>
</tr>
<tr>
<td>The One Ranges Proposal</td>
<td>Readable<br>WeaklyIncrementable<br>Incrementable<br>Iterator<br>InputIterator<br>OutputIterator<br>ForwardIterator<br>BidirectionalIterator<br>RandomAccessIterator<br>ContiguousIterator<br>Permutable<br>Range<br>SizedRange<br>View<br>CommonRange<br>InputRange<br>ForwardRange<br>BidirectionalRange<br>RandomAccessRange<br>ContiguousRange<br>ViewableRange<br></td>
<td>Writable<br>Sentinel<br>SizedSentinel<br>IndirectUnaryInvocable<br>IndirectRegularUnaryInvocable<br>IndirectUnaryPredicate<br>IndirectRelation<br>IndirectStrictWeakOrder<br>IndirectlyMovable<br>IndirectlyMovableStorable<br>IndirectlyCopyable<br>IndirectlyCopyableStorable<br>IndirectlySwappable<br>IndirectlyComparable<br>Mergeable<br>Sortable<br>OutputRange<br></td>
</tr>
</tbody>
</table><p>One might argue that “can take multiple arguments” does not necessarily mean that this concept wants to declare multiple type parameters at the same time.  For example, <code>Sentinel</code> has only been used for declaring one type parameter in the ranges library:</p><pre><code class="c++ hljs"><span class="hljs-keyword">template</span>&lt;Iterator I, Sentinel&lt;I&gt; S&gt;
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">advance</span><span class="hljs-params">(I&amp; i, S bound)</span></span>;
</code></pre><p>However, <code>Sentinel&lt;S, I&gt;</code> already requires <code>I</code> to satisfy <code>Iterator</code>, so given the proposed functionality, we can rewrite the above generic function as</p><pre><code class="c++ hljs"><span class="hljs-keyword">template</span>&lt;Sentinel S I&gt;
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">advance</span><span class="hljs-params">(I&amp; i, S bound)</span></span>;
</code></pre><p>Although this version introduces the template parameters in the reversed order and has vague meaning, it implies that as long as a concept can take multiple arguments, it can potentially make use of the capability of introducing those template parameters at once.  We can trivially resolve both issues mentioned earlier with a new concept that switches the parameters:</p><pre><code class="c++ hljs"><span class="hljs-keyword">template</span>&lt;<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">I</span>, <span class="hljs-title">class</span> <span class="hljs-title">S</span>&gt;
<span class="hljs-title">concept</span> <span class="hljs-title">Traversable</span> = <span class="hljs-title">Sentinel</span>&lt;S, I&gt;;</span>

<span class="hljs-keyword">template</span>&lt;Traversable I S&gt;
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">advance</span><span class="hljs-params">(I&amp; i, S bound)</span></span>;
</code></pre><h3 id="Multi-parameter-concepts-are-like-multi-parameter-functions" style=""><a class="anchor hidden-xs" href="#Multi-parameter-concepts-are-like-multi-parameter-functions" title="Multi-parameter-concepts-are-like-multi-parameter-functions"><span class="octicon octicon-link"></span></a>Multi-parameter concepts are like multi-parameter functions</h3><p>It is unclear what does “complex” mean in the term “complex concepts.”  It may mean “more stuff to specify,” but there is no evidence showing that the multi-parameter concepts take more LoC to specify comparing to the unary concepts, especially when the <code>Boolean</code> concept takes 17 LoC.  Or it may mean “more logical components,” then one might be surprised that <code>MoveConstructible</code> is not even a special case of <code>Constructible</code>,</p><pre><code class="c++ hljs"><span class="hljs-keyword">template</span>&lt;<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">T</span>&gt;
<span class="hljs-title">concept</span> <span class="hljs-title">MoveConstructible</span> = <span class="hljs-title">Constructible</span>&lt;T, T&gt; &amp;&amp; <span class="hljs-title">ConvertibleTo</span>&lt;T, T&gt;;</span>
</code></pre><p>nor does <code>CopyConstructible</code>:</p><pre><code class="c++ hljs"><span class="hljs-keyword">template</span>&lt;<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">T</span>&gt;
<span class="hljs-title">concept</span> <span class="hljs-title">CopyConstructible</span> = <span class="hljs-title">MoveConstructible</span>&lt;T&gt; &amp;&amp;
    <span class="hljs-title">Constructible</span>&lt;T, T&amp;&gt; &amp;&amp; <span class="hljs-title">ConvertibleTo</span>&lt;T&amp;, T&gt; &amp;&amp;
    <span class="hljs-title">Constructible</span>&lt;T, const T&amp;&gt; &amp;&amp; <span class="hljs-title">ConvertibleTo</span>&lt;const T&amp;, T&gt; &amp;&amp;
    <span class="hljs-title">Constructible</span>&lt;T, const T&gt; &amp;&amp; <span class="hljs-title">ConvertibleTo</span>&lt;const T, T&gt;;</span>
</code></pre><p>We must recognize that multi-parameter concepts are not more special comparing to the multi-parameter functions.  If they look complicated, the survey on the ranges library shows a possibility – given the status quo, the library can only introduce the template parameters one at a time.  Here is an example: we almost always (32 out of 34) use the <code>IndirectUnaryPredicate</code> concept together with the <code>projected</code> wrapper,</p><pre><code class="c++ hljs"><span class="hljs-keyword">template</span>&lt;InputIterator I, Sentinel&lt;I&gt; S, <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Proj</span> = <span class="hljs-title">identity</span>,
         <span class="hljs-title">IndirectUnaryPredicate</span>&lt;projected&lt;I, Proj&gt;&gt; <span class="hljs-title">Pred</span>&gt;
<span class="hljs-title">bool</span> <span class="hljs-title">all_of</span>(<span class="hljs-title">I</span> <span class="hljs-title">first</span>, <span class="hljs-title">S</span> <span class="hljs-title">last</span>, <span class="hljs-title">Pred</span> <span class="hljs-title">pred</span>, <span class="hljs-title">Proj</span> <span class="hljs-title">proj</span> = <span class="hljs-title">Proj</span>{</span>});
</code></pre><p>but defining a concept that captures this pattern (see also <code>IndirectlyComparable</code>)</p><pre><code class="c++ hljs"><span class="hljs-keyword">template</span>&lt;<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Proj</span>, <span class="hljs-title">class</span> <span class="hljs-title">F</span>, <span class="hljs-title">class</span> <span class="hljs-title">I</span>&gt;
<span class="hljs-title">concept</span> <span class="hljs-title">ProjectedUnaryPredicate</span> = <span class="hljs-title">IndirectUnaryPredicate</span>&lt;F, projected&lt;I, Proj&gt;&gt;;</span>
</code></pre><p>is not making the specification significantly more clear because we at least need to introduce one type parameter unconstrained:</p><pre><code class="c++ hljs"><span class="hljs-keyword">template</span>&lt;InputIterator I, Sentinel&lt;I&gt; S, <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Proj</span>,
         <span class="hljs-title">ProjectedUnaryPredicate</span>&lt;I, Proj&gt; <span class="hljs-title">Pred</span>&gt;
<span class="hljs-title">bool</span> <span class="hljs-title">all_of</span>(<span class="hljs-title">I</span> <span class="hljs-title">first</span>, <span class="hljs-title">S</span> <span class="hljs-title">last</span>, <span class="hljs-title">Pred</span> <span class="hljs-title">pred</span>, <span class="hljs-title">Proj</span> <span class="hljs-title">proj</span>);</span>
</code></pre><p>This verbosity goes away as soon as we can declare multiple template parameters at once:</p><pre><code class="c++ hljs"><span class="hljs-keyword">template</span>&lt;InputIterator I, Sentinel&lt;I&gt; S,
         ProjectedUnaryPredicate&lt;I&gt; Proj Pred&gt;
<span class="hljs-function"><span class="hljs-keyword">bool</span> <span class="hljs-title">all_of</span><span class="hljs-params">(I first, S last, Pred pred, Proj proj)</span></span>;
</code></pre><p>Combining with</p><pre><code class="c++ hljs"><span class="hljs-keyword">template</span>&lt;<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">I</span>, <span class="hljs-title">class</span> <span class="hljs-title">S</span>&gt;
<span class="hljs-title">concept</span> <span class="hljs-title">InputTraversable</span> = <span class="hljs-title">InputIterator</span>&lt;I&gt; &amp;&amp; <span class="hljs-title">Sentinel</span>&lt;S, I&gt;;</span>
</code></pre><p>, we can rewrite the full declarations of <code>ranges::all_of</code></p><pre><code class="c++ hljs"><span class="hljs-keyword">template</span>&lt;InputIterator I, Sentinel&lt;I&gt; S, <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Proj</span> = <span class="hljs-title">identity</span>,
    <span class="hljs-title">IndirectUnaryPredicate</span>&lt;projected&lt;I, Proj&gt;&gt; <span class="hljs-title">Pred</span>&gt;
  <span class="hljs-title">bool</span> <span class="hljs-title">all_of</span>(<span class="hljs-title">I</span> <span class="hljs-title">first</span>, <span class="hljs-title">S</span> <span class="hljs-title">last</span>, <span class="hljs-title">Pred</span> <span class="hljs-title">pred</span>, <span class="hljs-title">Proj</span> <span class="hljs-title">proj</span> = <span class="hljs-title">Proj</span>{</span>});
<span class="hljs-keyword">template</span>&lt;InputRange Rng, <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Proj</span> = <span class="hljs-title">identity</span>,
    <span class="hljs-title">IndirectUnaryPredicate</span>&lt;projected&lt;iterator_t&lt;Rng&gt;, Proj&gt;&gt; <span class="hljs-title">Pred</span>&gt;
  <span class="hljs-title">bool</span> <span class="hljs-title">all_of</span>(<span class="hljs-title">Rng</span>&amp;&amp; <span class="hljs-title">rng</span>, <span class="hljs-title">Pred</span> <span class="hljs-title">pred</span>, <span class="hljs-title">Proj</span> <span class="hljs-title">proj</span> = <span class="hljs-title">Proj</span>{</span>});
</code></pre><p>into</p><pre><code class="c++ hljs"><span class="hljs-keyword">template</span>&lt;InputTraversable I S, IndirectUnaryPredicate&lt;I&gt; Pred&gt;
  <span class="hljs-function"><span class="hljs-keyword">bool</span> <span class="hljs-title">all_of</span><span class="hljs-params">(I first, S last, Pred pred)</span></span>;
<span class="hljs-keyword">template</span>&lt;InputTraversable I S, ProjectedUnaryPredicate&lt;I&gt; Proj Pred&gt;
  <span class="hljs-function"><span class="hljs-keyword">bool</span> <span class="hljs-title">all_of</span><span class="hljs-params">(I first, S last, Pred pred, Proj)</span></span>;

<span class="hljs-keyword">template</span>&lt;InputRange Rng, IndirectUnaryPredicate&lt;<span class="hljs-keyword">iterator_t</span>&lt;Rng&gt;&gt; Pred&gt;
  <span class="hljs-function"><span class="hljs-keyword">bool</span> <span class="hljs-title">all_of</span><span class="hljs-params">(Rng&amp;&amp; rng, Pred pred)</span></span>;
<span class="hljs-keyword">template</span>&lt;InputRange Rng, ProjectedUnaryPredicate&lt;<span class="hljs-keyword">iterator_t</span>&lt;Rng&gt;&gt; Proj Pred&gt;
  <span class="hljs-function"><span class="hljs-keyword">bool</span> <span class="hljs-title">all_of</span><span class="hljs-params">(Rng&amp;&amp; rng, Pred pred, Proj)</span></span>;
</code></pre><p>Now all the template parameters are constrained at the time of being introduced.  There is little need for mental type arithmetic after only a few tweaks to the complex specifications that would not benefit from the proposed functionality at first glance, what you see then is what you get.</p><h2 id="Discussion" style=""><a class="anchor hidden-xs" href="#Discussion" title="Discussion"><span class="octicon octicon-link"></span></a>Discussion</h2><h3 id="Why-such-an-alien-syntax" style=""><a class="anchor hidden-xs" href="#Why-such-an-alien-syntax" title="Why-such-an-alien-syntax"><span class="octicon octicon-link"></span></a>Why such an alien syntax?</h3><p>Because the idea is alien.  C++ yet has the following setting: introducing both <span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-1-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><mi>a</mi></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1" style="width: 0.649em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.539em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(1.876em, 1000.52em, 2.65em, -1000em); top: -2.478em; left: 0em;"><span class="mrow" id="MathJax-Span-2"><span class="mi" id="MathJax-Span-3" style="font-family: MathJax_Math; font-style: italic;">a</span></span><span style="display: inline-block; width: 0px; height: 2.478em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.074em; border-left: 0px solid; width: 0px; height: 0.648em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>a</mi></math></span></span><script type="math/tex" id="MathJax-Element-1">a</script></span> and <span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-2-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><mi>b</mi></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-4" style="width: 0.541em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.431em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(1.623em, 1000.42em, 2.651em, -1000em); top: -2.478em; left: 0em;"><span class="mrow" id="MathJax-Span-5"><span class="mi" id="MathJax-Span-6" style="font-family: MathJax_Math; font-style: italic;">b</span></span><span style="display: inline-block; width: 0px; height: 2.478em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.075em; border-left: 0px solid; width: 0px; height: 0.943em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>b</mi></math></span></span><script type="math/tex" id="MathJax-Element-2">b</script></span> is the only way for <span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-3-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><mi>X</mi></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-7" style="width: 1.026em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.862em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(1.634em, 1000.86em, 2.64em, -1000em); top: -2.478em; left: 0em;"><span class="mrow" id="MathJax-Span-8"><span class="mi" id="MathJax-Span-9" style="font-family: MathJax_Math; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.024em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.478em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.063em; border-left: 0px solid; width: 0px; height: 0.917em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>X</mi></math></span></span><script type="math/tex" id="MathJax-Element-3">X</script></span> to declare anything.  For example, let <span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-4-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><mi>X</mi></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-10" style="width: 1.026em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.862em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(1.634em, 1000.86em, 2.64em, -1000em); top: -2.478em; left: 0em;"><span class="mrow" id="MathJax-Span-11"><span class="mi" id="MathJax-Span-12" style="font-family: MathJax_Math; font-style: italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.024em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.478em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.063em; border-left: 0px solid; width: 0px; height: 0.917em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>X</mi></math></span></span><script type="math/tex" id="MathJax-Element-4">X</script></span> be <code>int</code>, then <code>int a, b;</code> declares <code>a</code> and <code>b</code>, but <code>int</code> can also introduce only one name with <code>int a;</code>.  Given <code>pair&lt;bool, int&gt; foo();</code>, <code>auto [a, b] = foo();</code> declares <code>a</code> and <code>b</code>; but <code>auto</code> can also introduce only one name with <code>auto a = foo();</code>.  The proposed syntax, <em>qualified-concept-name</em> followed by a list of identifiers that has no separator token between them, ensures sufficient unfamiliarity so that nothing else in the language (such as <em>enum-specifier</em>) come to mind when a user see this in code.</p><p>About why this specific syntax, continuing our “function” metaphor: a unary function is a multi-parameter function with an arity of 1, so the author comes up with a design such that a unary <em>constrained-parameter</em>, as specified in the working paper<sup class="footnote-ref"><a href="#fn5" id="fnref5">[5]</a></sup>, not only semantically, but also syntactically, is a multi-argument constrained parameter with an arity of 1.</p><h3 id="Template-declaration-is-ugly" style=""><a class="anchor hidden-xs" href="#Template-declaration-is-ugly" title="Template-declaration-is-ugly"><span class="octicon octicon-link"></span></a>Template declaration is ugly!</h3><p>So we should make <em>template-declaration</em> less ugly.  Here is a proposal:</p><blockquote>
<p><em>template-head</em>:<br>
&nbsp;&nbsp;&nbsp;&nbsp;<code>template</code><ins><em><sub>opt</sub></em></ins> <code>&lt;</code> <em>template-parameter-list</em> <code>&gt;</code> <em>requires-clause<sub>opt</sub></em></p>
</blockquote><blockquote>
<p><em>explicit-specialization</em>:<br>
&nbsp;&nbsp;&nbsp;&nbsp;<code>template</code><ins><em><sub>opt</sub></em></ins> <code>&lt;</code> <code>&gt;</code> <em>declaration</em></p>
</blockquote><p>With this change, a generic function declaration will get closer to a generic lambda:</p><pre><code class="cpp hljs"><span class="token keyword">auto</span> f <span class="token operator">=</span> <span class="token operator">&lt;</span>Iterator I<span class="token operator">&gt;</span><span class="token punctuation">(</span>I first<span class="token punctuation">,</span> I last<span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token comment">/* ... */</span> <span class="token punctuation">}</span><span class="token punctuation">;</span>
  <span class="token operator">&lt;</span>Iterator I<span class="token operator">&gt;</span> <span class="token keyword">auto</span> <span class="token function">g</span><span class="token punctuation">(</span>I first<span class="token punctuation">,</span> I last<span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token comment">/* ... */</span> <span class="token punctuation">}</span>

<span class="token keyword">auto</span> f <span class="token operator">=</span> <span class="token operator">&lt;</span>Traversable I S<span class="token operator">&gt;</span><span class="token punctuation">(</span>I first<span class="token punctuation">,</span> S last<span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token comment">/* ... */</span> <span class="token punctuation">}</span><span class="token punctuation">;</span>
  <span class="token operator">&lt;</span>Traversable I S<span class="token operator">&gt;</span> <span class="token keyword">auto</span> <span class="token function">g</span><span class="token punctuation">(</span>I first<span class="token punctuation">,</span> S last<span class="token punctuation">)</span> <span class="token punctuation">{</span> <span class="token comment">/* ... */</span> <span class="token punctuation">}</span>
</code></pre><h3 id="Should-we-reserve-this-syntax-for-adjective-conjunction-concepts" style=""><a class="anchor hidden-xs" href="#Should-we-reserve-this-syntax-for-adjective-conjunction-concepts" title="Should-we-reserve-this-syntax-for-adjective-conjunction-concepts"><span class="octicon octicon-link"></span></a>Should we reserve this syntax for adjective conjunction concepts?</h3><p>It was suggested that a constrained parameter such as <code>Sortable Container X</code> should declare <code>X</code> that requires <code>Sortable&lt;X&gt; &amp;&amp; Container&lt;X&gt;</code>.  There are two premises for this interpretation to be useful:</p><ol>
<li>Both concepts involved are unary;</li>
<li>One concept does not subsume the other.</li>
</ol><p>Whether it is possible for all <code>Containers</code> being <code>Sortable</code> or all <code>Sortable</code> being <code>Containers</code> is something we cannot tell from undefined concepts.  Therefore the author surveyed the ranges library to look for the signatures that have constraints satisfying 1) and 2).</p><p>The survey shows that among all the constraints additionally supplied, one concept (<code>Permutable</code>) involved is unary; among the 8 algorithms (16 signatures) where <code>Permutable</code> is spelled out, 3 signatures (iterator version <code>reverse</code>, <code>stable_partition</code>, <code>shuffle</code>) can actually benefit from the adjective conjunction syntax.  Note that <code>Permutable</code> already subsumes <code>ForwardIterator</code> so sometimes the later is not necessary, but the wording has the convention of not to use an adjective <em>concept-name</em> to declare a <em>constrained-parameter</em>.</p><p>So it seems that the suggested idea is not very useful within one generic library.  What about the case when the concepts come from different generic libraries?  The author does not have real code to make a call but suspects that such a syntax may be misleading because partial ordering independently defined concepts can give unexpected results.</p><p>To answer the question in the heading: not worth it.</p><h3 id="How-do-I-omit-the-template-parameter-names" style=""><a class="anchor hidden-xs" href="#How-do-I-omit-the-template-parameter-names" title="How-do-I-omit-the-template-parameter-names"><span class="octicon octicon-link"></span></a>How do I omit the template parameter names?</h3><p>The short answer is you cannot.  A more professional answer is that you can only omit the <em>prototype parameter</em> for a given concept.  This rule explains the status quo and uniformly applies to both unary concepts and multi-parameter concepts.  For example,</p><pre><code class="c++ hljs"><span class="hljs-keyword">template</span>&lt;<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">T</span>&gt;
  <span class="hljs-title">concept</span> <span class="hljs-title">EqualityComparable</span> = /* ... */;</span>
<span class="hljs-keyword">template</span>&lt;<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">T</span>, <span class="hljs-title">class</span> <span class="hljs-title">U</span>&gt;
  <span class="hljs-title">concept</span> <span class="hljs-title">EqualityComparableWith</span> = /* ... */;</span>
</code></pre><p>The <em>constrained-parameters</em> <code>EqualityComparable X</code>, <code>EqualityComparableWith X Y</code>, and <code>EqualityComparableWith&lt;Y&gt; X</code> are legal because they are not omitting any name; <code>EqualityComparable</code> and <code>EqualityComparableWith&lt;Y&gt;</code> are also legal because they are omitting their prototype parameter <code>T</code>.  But <code>EqualityComparableWith X</code> is illegal because it intends to omit <code>U</code> which is not a prototype parameter.</p><p>The outcome of the design is WYSIWYG – a reader of the code can easily infer how many template parameters there are from a declaration.  If a <em>qualified-concept-name</em> has no identifier to follow it, it introduces an unnamed template parameter; otherwise, the number of the identifiers following it is the number of template parameters it declares.</p><h3 id="Where-are-the-default-arguments" style=""><a class="anchor hidden-xs" href="#Where-are-the-default-arguments" title="Where-are-the-default-arguments"><span class="octicon octicon-link"></span></a>Where are the default arguments?</h3><p>They are not sufficiently motivated given the <a href="#Multi-parameter-concepts-are-like-multi-parameter-functions">examples</a>.  It may also be worth noticing that neither Concepts TS<sup class="footnote-ref"><a href="#fn6" id="fnref6">[6]</a></sup> nor the in-place syntax<sup class="footnote-ref"><a href="#fn7" id="fnref7">[7]</a></sup> allows default arguments on the multi-argument concept name introducer notions.</p><h2 id="Technical-Specification" style=""><a class="anchor hidden-xs" href="#Technical-Specification" title="Technical-Specification"><span class="octicon octicon-link"></span></a>Technical Specification</h2><blockquote>
<p><em>constrained-parameter</em>:<br>
&nbsp;&nbsp;&nbsp;&nbsp;<em>qualified-concept-name</em> … <em>identifier<sub>opt</sub></em><br>
&nbsp;&nbsp;&nbsp;&nbsp;<em>qualified-concept-name</em> <em>identifier<sub>opt</sub></em> <em>default-template-argument<s><sub>opt</sub></s></em><br>
&nbsp;&nbsp;&nbsp;&nbsp;<ins><em>qualified-concept-name</em> <em>identifier-seq</em></ins><br>
<br>
<ins><em>identifier-seq</em>:</ins><br>
&nbsp;&nbsp;&nbsp;&nbsp;<ins><em>identifier</em></ins><br>
&nbsp;&nbsp;&nbsp;&nbsp;<ins><em>identifier-seq</em> <em>identifier</em></ins><br></p>
<p>A <em>constrained-parameter</em> introduces a <em>constraint-expression</em> (<a href="http://eel.is/c++draft/temp.constr.decl" target="_blank">12.4.2</a>). The expression is derived from the <em>qualified-concept-name</em> Q in the <em>constrained-parameter</em>, its designated concept C, and the declared template parameters P<span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-5-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><msub><mi></mi><mn>1</mn></msub></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-13" style="width: 0.541em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.431em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(1.942em, 1000.43em, 2.736em, -1000em); top: -2.425em; left: 0em;"><span class="mrow" id="MathJax-Span-14"><span class="msubsup" id="MathJax-Span-15"><span style="display: inline-block; position: relative; width: 0.429em; height: 0px;"><span style="position: absolute; clip: rect(3.825em, 1000em, 4.149em, -1000em); top: -3.987em; left: 0em;"><span class="mi" id="MathJax-Span-16"></span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span><span style="position: absolute; top: -3.837em; left: 0em;"><span class="mn" id="MathJax-Span-17" style="font-size: 70.7%; font-family: MathJax_Main;">1</span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.425em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.236em; border-left: 0px solid; width: 0px; height: 0.671em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi></mi><mn>1</mn></msub></math></span></span><script type="math/tex" id="MathJax-Element-5">_1</script></span>, P<span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-6-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><msub><mi></mi><mn>2</mn></msub></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-18" style="width: 0.541em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.431em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(1.942em, 1000.43em, 2.736em, -1000em); top: -2.425em; left: 0em;"><span class="mrow" id="MathJax-Span-19"><span class="msubsup" id="MathJax-Span-20"><span style="display: inline-block; position: relative; width: 0.429em; height: 0px;"><span style="position: absolute; clip: rect(3.825em, 1000em, 4.149em, -1000em); top: -3.987em; left: 0em;"><span class="mi" id="MathJax-Span-21"></span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span><span style="position: absolute; top: -3.837em; left: 0em;"><span class="mn" id="MathJax-Span-22" style="font-size: 70.7%; font-family: MathJax_Main;">2</span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.425em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.236em; border-left: 0px solid; width: 0px; height: 0.671em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi></mi><mn>2</mn></msub></math></span></span><script type="math/tex" id="MathJax-Element-6">_2</script></span>, …, P<span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-7-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><msub><mi></mi><mi>n</mi></msub></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-23" style="width: 0.595em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.485em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(2.1em, 1000.48em, 2.744em, -1000em); top: -2.425em; left: 0em;"><span class="mrow" id="MathJax-Span-24"><span class="msubsup" id="MathJax-Span-25"><span style="display: inline-block; position: relative; width: 0.499em; height: 0px;"><span style="position: absolute; clip: rect(3.825em, 1000em, 4.149em, -1000em); top: -3.987em; left: 0em;"><span class="mi" id="MathJax-Span-26"></span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span><span style="position: absolute; top: -3.837em; left: 0em;"><span class="mi" id="MathJax-Span-27" style="font-size: 70.7%; font-family: MathJax_Math; font-style: italic;">n</span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.425em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.246em; border-left: 0px solid; width: 0px; height: 0.497em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi></mi><mi>n</mi></msub></math></span></span><script type="math/tex" id="MathJax-Element-7">_n</script></span>.</p>
<p>An <em>id-expression</em> E is formed as follows. If Q is a <em>concept-name</em>, then E is C&lt;P<span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-8-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><msub><mi></mi><mn>1</mn></msub></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-28" style="width: 0.541em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.431em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(1.942em, 1000.43em, 2.736em, -1000em); top: -2.425em; left: 0em;"><span class="mrow" id="MathJax-Span-29"><span class="msubsup" id="MathJax-Span-30"><span style="display: inline-block; position: relative; width: 0.429em; height: 0px;"><span style="position: absolute; clip: rect(3.825em, 1000em, 4.149em, -1000em); top: -3.987em; left: 0em;"><span class="mi" id="MathJax-Span-31"></span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span><span style="position: absolute; top: -3.837em; left: 0em;"><span class="mn" id="MathJax-Span-32" style="font-size: 70.7%; font-family: MathJax_Main;">1</span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.425em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.236em; border-left: 0px solid; width: 0px; height: 0.671em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi></mi><mn>1</mn></msub></math></span></span><script type="math/tex" id="MathJax-Element-8">_1</script></span>, P<span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-9-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><msub><mi></mi><mn>2</mn></msub></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-33" style="width: 0.541em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.431em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(1.942em, 1000.43em, 2.736em, -1000em); top: -2.425em; left: 0em;"><span class="mrow" id="MathJax-Span-34"><span class="msubsup" id="MathJax-Span-35"><span style="display: inline-block; position: relative; width: 0.429em; height: 0px;"><span style="position: absolute; clip: rect(3.825em, 1000em, 4.149em, -1000em); top: -3.987em; left: 0em;"><span class="mi" id="MathJax-Span-36"></span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span><span style="position: absolute; top: -3.837em; left: 0em;"><span class="mn" id="MathJax-Span-37" style="font-size: 70.7%; font-family: MathJax_Main;">2</span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.425em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.236em; border-left: 0px solid; width: 0px; height: 0.671em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi></mi><mn>2</mn></msub></math></span></span><script type="math/tex" id="MathJax-Element-9">_2</script></span>, …, P<span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-10-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><msub><mi></mi><mi>n</mi></msub></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-38" style="width: 0.595em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.485em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(2.1em, 1000.48em, 2.744em, -1000em); top: -2.425em; left: 0em;"><span class="mrow" id="MathJax-Span-39"><span class="msubsup" id="MathJax-Span-40"><span style="display: inline-block; position: relative; width: 0.499em; height: 0px;"><span style="position: absolute; clip: rect(3.825em, 1000em, 4.149em, -1000em); top: -3.987em; left: 0em;"><span class="mi" id="MathJax-Span-41"></span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span><span style="position: absolute; top: -3.837em; left: 0em;"><span class="mi" id="MathJax-Span-42" style="font-size: 70.7%; font-family: MathJax_Math; font-style: italic;">n</span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.425em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.246em; border-left: 0px solid; width: 0px; height: 0.497em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi></mi><mi>n</mi></msub></math></span></span><script type="math/tex" id="MathJax-Element-10">_n</script></span>&gt;.  Otherwise, Q is a <em>partial-concept-id</em> of the form C&lt;A<span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-11-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><msub><mi></mi><mn>1</mn></msub></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-43" style="width: 0.541em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.431em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(1.942em, 1000.43em, 2.736em, -1000em); top: -2.425em; left: 0em;"><span class="mrow" id="MathJax-Span-44"><span class="msubsup" id="MathJax-Span-45"><span style="display: inline-block; position: relative; width: 0.429em; height: 0px;"><span style="position: absolute; clip: rect(3.825em, 1000em, 4.149em, -1000em); top: -3.987em; left: 0em;"><span class="mi" id="MathJax-Span-46"></span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span><span style="position: absolute; top: -3.837em; left: 0em;"><span class="mn" id="MathJax-Span-47" style="font-size: 70.7%; font-family: MathJax_Main;">1</span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.425em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.236em; border-left: 0px solid; width: 0px; height: 0.671em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi></mi><mn>1</mn></msub></math></span></span><script type="math/tex" id="MathJax-Element-11">_1</script></span>, A<span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-12-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><msub><mi></mi><mn>2</mn></msub></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-48" style="width: 0.541em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.431em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(1.942em, 1000.43em, 2.736em, -1000em); top: -2.425em; left: 0em;"><span class="mrow" id="MathJax-Span-49"><span class="msubsup" id="MathJax-Span-50"><span style="display: inline-block; position: relative; width: 0.429em; height: 0px;"><span style="position: absolute; clip: rect(3.825em, 1000em, 4.149em, -1000em); top: -3.987em; left: 0em;"><span class="mi" id="MathJax-Span-51"></span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span><span style="position: absolute; top: -3.837em; left: 0em;"><span class="mn" id="MathJax-Span-52" style="font-size: 70.7%; font-family: MathJax_Main;">2</span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.425em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.236em; border-left: 0px solid; width: 0px; height: 0.671em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi></mi><mn>2</mn></msub></math></span></span><script type="math/tex" id="MathJax-Element-12">_2</script></span>, …, A<span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-13-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><msub><mi></mi><mi>m</mi></msub></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-53" style="width: 0.811em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.7em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(2.1em, 1000.7em, 2.744em, -1000em); top: -2.425em; left: 0em;"><span class="mrow" id="MathJax-Span-54"><span class="msubsup" id="MathJax-Span-55"><span style="display: inline-block; position: relative; width: 0.696em; height: 0px;"><span style="position: absolute; clip: rect(3.825em, 1000em, 4.149em, -1000em); top: -3.987em; left: 0em;"><span class="mi" id="MathJax-Span-56"></span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span><span style="position: absolute; top: -3.837em; left: 0em;"><span class="mi" id="MathJax-Span-57" style="font-size: 70.7%; font-family: MathJax_Math; font-style: italic;">m</span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.425em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.246em; border-left: 0px solid; width: 0px; height: 0.497em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi></mi><mi>m</mi></msub></math></span></span><script type="math/tex" id="MathJax-Element-13">_m</script></span>&gt;, and E is C&lt;P<span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-14-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><msub><mi></mi><mn>1</mn></msub></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-58" style="width: 0.541em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.431em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(1.942em, 1000.43em, 2.736em, -1000em); top: -2.425em; left: 0em;"><span class="mrow" id="MathJax-Span-59"><span class="msubsup" id="MathJax-Span-60"><span style="display: inline-block; position: relative; width: 0.429em; height: 0px;"><span style="position: absolute; clip: rect(3.825em, 1000em, 4.149em, -1000em); top: -3.987em; left: 0em;"><span class="mi" id="MathJax-Span-61"></span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span><span style="position: absolute; top: -3.837em; left: 0em;"><span class="mn" id="MathJax-Span-62" style="font-size: 70.7%; font-family: MathJax_Main;">1</span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.425em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.236em; border-left: 0px solid; width: 0px; height: 0.671em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi></mi><mn>1</mn></msub></math></span></span><script type="math/tex" id="MathJax-Element-14">_1</script></span>, P<span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-15-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><msub><mi></mi><mn>2</mn></msub></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-63" style="width: 0.541em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.431em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(1.942em, 1000.43em, 2.736em, -1000em); top: -2.425em; left: 0em;"><span class="mrow" id="MathJax-Span-64"><span class="msubsup" id="MathJax-Span-65"><span style="display: inline-block; position: relative; width: 0.429em; height: 0px;"><span style="position: absolute; clip: rect(3.825em, 1000em, 4.149em, -1000em); top: -3.987em; left: 0em;"><span class="mi" id="MathJax-Span-66"></span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span><span style="position: absolute; top: -3.837em; left: 0em;"><span class="mn" id="MathJax-Span-67" style="font-size: 70.7%; font-family: MathJax_Main;">2</span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.425em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.236em; border-left: 0px solid; width: 0px; height: 0.671em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi></mi><mn>2</mn></msub></math></span></span><script type="math/tex" id="MathJax-Element-15">_2</script></span>, …, P<span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-16-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><msub><mi></mi><mi>n</mi></msub></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-68" style="width: 0.595em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.485em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(2.1em, 1000.48em, 2.744em, -1000em); top: -2.425em; left: 0em;"><span class="mrow" id="MathJax-Span-69"><span class="msubsup" id="MathJax-Span-70"><span style="display: inline-block; position: relative; width: 0.499em; height: 0px;"><span style="position: absolute; clip: rect(3.825em, 1000em, 4.149em, -1000em); top: -3.987em; left: 0em;"><span class="mi" id="MathJax-Span-71"></span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span><span style="position: absolute; top: -3.837em; left: 0em;"><span class="mi" id="MathJax-Span-72" style="font-size: 70.7%; font-family: MathJax_Math; font-style: italic;">n</span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.425em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.246em; border-left: 0px solid; width: 0px; height: 0.497em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi></mi><mi>n</mi></msub></math></span></span><script type="math/tex" id="MathJax-Element-16">_n</script></span>, A<span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-17-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><msub><mi></mi><mn>1</mn></msub></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-73" style="width: 0.541em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.431em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(1.942em, 1000.43em, 2.736em, -1000em); top: -2.425em; left: 0em;"><span class="mrow" id="MathJax-Span-74"><span class="msubsup" id="MathJax-Span-75"><span style="display: inline-block; position: relative; width: 0.429em; height: 0px;"><span style="position: absolute; clip: rect(3.825em, 1000em, 4.149em, -1000em); top: -3.987em; left: 0em;"><span class="mi" id="MathJax-Span-76"></span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span><span style="position: absolute; top: -3.837em; left: 0em;"><span class="mn" id="MathJax-Span-77" style="font-size: 70.7%; font-family: MathJax_Main;">1</span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.425em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.236em; border-left: 0px solid; width: 0px; height: 0.671em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi></mi><mn>1</mn></msub></math></span></span><script type="math/tex" id="MathJax-Element-17">_1</script></span>, A<span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-18-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><msub><mi></mi><mn>2</mn></msub></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-78" style="width: 0.541em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.431em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(1.942em, 1000.43em, 2.736em, -1000em); top: -2.425em; left: 0em;"><span class="mrow" id="MathJax-Span-79"><span class="msubsup" id="MathJax-Span-80"><span style="display: inline-block; position: relative; width: 0.429em; height: 0px;"><span style="position: absolute; clip: rect(3.825em, 1000em, 4.149em, -1000em); top: -3.987em; left: 0em;"><span class="mi" id="MathJax-Span-81"></span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span><span style="position: absolute; top: -3.837em; left: 0em;"><span class="mn" id="MathJax-Span-82" style="font-size: 70.7%; font-family: MathJax_Main;">2</span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.425em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.236em; border-left: 0px solid; width: 0px; height: 0.671em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi></mi><mn>2</mn></msub></math></span></span><script type="math/tex" id="MathJax-Element-18">_2</script></span>, …, A<span class="mathjax"><span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-19-Frame" tabindex="0" style="position: relative;" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><msub><mi></mi><mi>m</mi></msub></math>" role="presentation"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-83" style="width: 0.811em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.7em; height: 0px; font-size: 116%;"><span style="position: absolute; clip: rect(2.1em, 1000.7em, 2.744em, -1000em); top: -2.425em; left: 0em;"><span class="mrow" id="MathJax-Span-84"><span class="msubsup" id="MathJax-Span-85"><span style="display: inline-block; position: relative; width: 0.696em; height: 0px;"><span style="position: absolute; clip: rect(3.825em, 1000em, 4.149em, -1000em); top: -3.987em; left: 0em;"><span class="mi" id="MathJax-Span-86"></span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span><span style="position: absolute; top: -3.837em; left: 0em;"><span class="mi" id="MathJax-Span-87" style="font-size: 70.7%; font-family: MathJax_Math; font-style: italic;">m</span><span style="display: inline-block; width: 0px; height: 3.987em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.425em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.246em; border-left: 0px solid; width: 0px; height: 0.497em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi></mi><mi>m</mi></msub></math></span></span><script type="math/tex" id="MathJax-Element-19">_m</script></span>&gt;.</p>
<p>E is the introduced <em>constraint-expression</em>.</p>
</blockquote><p>This paper proposes only a syntax translation.  The capability of this syntax is up to the capability of a unary <em>constrained-parameter</em>.  If YAACD<sup class="footnote-ref"><a href="#fn8" id="fnref8">[8]</a></sup>, or a part of it, is adopted, a multi-argument <em>constrained-parameter</em> will introduce only type parameters; otherwise, given the status quo, a multi-argument <em>constrained-parameter</em> will be able to introduce template parameters of mixed kinds (type, non-type, template):</p><pre><code class="c++ hljs"><span class="hljs-keyword">template</span>&lt;<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">T</span>, <span class="hljs-title">auto</span> <span class="hljs-title">N</span>&gt;
<span class="hljs-title">concept</span> <span class="hljs-title">Array</span> = <span class="hljs-title">is_array_v</span>&lt;T[N]&gt;;</span>

<span class="hljs-keyword">template</span>&lt;Array T N&gt;
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">foo</span><span class="hljs-params">(<span class="hljs-built_in">std</span>::<span class="hljs-built_in">array</span>&lt;T, N&gt;&amp;)</span></span>;
</code></pre><h2 id="References" style=""><a class="anchor hidden-xs" href="#References" title="References"><span class="octicon octicon-link"></span></a>References</h2><hr class="footnotes-sep"><section class="footnotes">
<ol class="footnotes-list">
<li id="fn1" class="footnote-item"><p>Stroustrup, Bjarne. P1079 <em>A minimal solution to the concepts syntax problems</em>.
<a href="http://open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1079r0.pdf" target="_blank">http://open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1079r0.pdf</a> <a href="#fnref1" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn2" class="footnote-item"><p>Köppe, Thomas. P1142R0 <em>Thoughts on a conservative terse syntax for constraints</em>.
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1142r0.html" target="_blank">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1142r0.html</a> <a href="#fnref2" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn3" class="footnote-item"><p>Carter, Casey, and Eric Niebler. P0898R3 <em>Standard Library Concepts</em>.
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0898r3.pdf" target="_blank">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0898r3.pdf</a> <a href="#fnref3" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn4" class="footnote-item"><p>Niebler, Eric, et al. P0896R2 <em>The One Ranges Proposal</em>.
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r2.pdf" target="_blank">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r2.pdf</a> <a href="#fnref4" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn5" class="footnote-item"><p>Smith, Richard. N4762 <em>Working Draft, Standard for Programming Language C++</em>.
<a href="https://github.com/cplusplus/draft/raw/master/papers/n4762.pdf" target="_blank">https://github.com/cplusplus/draft/raw/master/papers/n4762.pdf</a> <a href="#fnref5" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn6" class="footnote-item"><p>Sutton, Andrew. N4674 <em>Working Draft, C++ extensions for Concepts</em>.
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4674.pdf" target="_blank">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4674.pdf</a> <a href="#fnref6" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn7" class="footnote-item"><p>Sutter, Herb. P0745R1 <em>Concepts in-place syntax</em>.
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0745r1.pdf" target="_blank">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0745r1.pdf</a> <a href="#fnref7" class="footnote-backref">↩︎</a></p>
</li>
<li id="fn8" class="footnote-item"><p>Voutilainen, Ville, et al. P1141R0 <em>Yet another approach for constrained declarations</em>.
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1141r0.html" target="_blank">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1141r0.html</a> <a href="#fnref8" class="footnote-backref">↩︎</a></p>
</li>
</ol>
</section></div>
    <div class="ui-toc dropup unselectable hidden-print" style="display:none;">
        <div class="pull-right dropdown">
            <a id="tocLabel" class="ui-toc-label btn btn-default" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false" title="Table of content">
                <i class="fa fa-bars"></i>
            </a>
            <ul id="ui-toc" class="ui-toc-dropdown dropdown-menu" aria-labelledby="tocLabel">
                <div class="toc"><ul class="nav"><li class=""><a href="#Multi-argument-constrained-parameter" title="Multi-argument constrained-parameter">Multi-argument constrained-parameter</a><ul class="nav"><li><a href="#Introduction" title="Introduction">Introduction</a></li><li><a href="#Motivation" title="Motivation">Motivation</a><ul class="nav"><li><a href="#Multi-parameter-type-concepts-are-not-uncommon" title="Multi-parameter type concepts are not uncommon">Multi-parameter type concepts are not uncommon</a></li><li><a href="#Multi-parameter-concepts-are-like-multi-parameter-functions" title="Multi-parameter concepts are like multi-parameter functions">Multi-parameter concepts are like multi-parameter functions</a></li></ul></li><li><a href="#Discussion" title="Discussion">Discussion</a><ul class="nav"><li><a href="#Why-such-an-alien-syntax" title="Why such an alien syntax?">Why such an alien syntax?</a></li><li><a href="#Template-declaration-is-ugly" title="Template declaration is ugly!">Template declaration is ugly!</a></li><li><a href="#Should-we-reserve-this-syntax-for-adjective-conjunction-concepts" title="Should we reserve this syntax for adjective conjunction concepts?">Should we reserve this syntax for adjective conjunction concepts?</a></li><li><a href="#How-do-I-omit-the-template-parameter-names" title="How do I omit the template parameter names?">How do I omit the template parameter names?</a></li><li><a href="#Where-are-the-default-arguments" title="Where are the default arguments?">Where are the default arguments?</a></li></ul></li><li><a href="#Technical-Specification" title="Technical Specification">Technical Specification</a></li><li><a href="#References" title="References">References</a></li></ul></li></ul></div><div class="toc-menu"><a class="expand-toggle" href="#">Expand all</a><a class="back-to-top" href="#">Back to top</a><a class="go-to-bottom" href="#">Go to bottom</a></div>
            </ul>
        </div>
    </div>
    <div id="ui-toc-affix" class="ui-affix-toc ui-toc-dropdown unselectable hidden-print" data-spy="affix" style="top:17px;display:none;"  >
        <div class="toc"><ul class="nav"><li class=""><a href="#Multi-argument-constrained-parameter" title="Multi-argument constrained-parameter">Multi-argument constrained-parameter</a><ul class="nav"><li><a href="#Introduction" title="Introduction">Introduction</a></li><li><a href="#Motivation" title="Motivation">Motivation</a><ul class="nav"><li><a href="#Multi-parameter-type-concepts-are-not-uncommon" title="Multi-parameter type concepts are not uncommon">Multi-parameter type concepts are not uncommon</a></li><li><a href="#Multi-parameter-concepts-are-like-multi-parameter-functions" title="Multi-parameter concepts are like multi-parameter functions">Multi-parameter concepts are like multi-parameter functions</a></li></ul></li><li><a href="#Discussion" title="Discussion">Discussion</a><ul class="nav"><li><a href="#Why-such-an-alien-syntax" title="Why such an alien syntax?">Why such an alien syntax?</a></li><li><a href="#Template-declaration-is-ugly" title="Template declaration is ugly!">Template declaration is ugly!</a></li><li><a href="#Should-we-reserve-this-syntax-for-adjective-conjunction-concepts" title="Should we reserve this syntax for adjective conjunction concepts?">Should we reserve this syntax for adjective conjunction concepts?</a></li><li><a href="#How-do-I-omit-the-template-parameter-names" title="How do I omit the template parameter names?">How do I omit the template parameter names?</a></li><li><a href="#Where-are-the-default-arguments" title="Where are the default arguments?">Where are the default arguments?</a></li></ul></li><li><a href="#Technical-Specification" title="Technical Specification">Technical Specification</a></li><li><a href="#References" title="References">References</a></li></ul></li></ul></div><div class="toc-menu"><a class="expand-toggle" href="#">Expand all</a><a class="back-to-top" href="#">Back to top</a><a class="go-to-bottom" href="#">Go to bottom</a></div>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous" defer></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/gist-embed/2.6.0/gist-embed.min.js" integrity="sha256-KyF2D6xPIJUW5sUDSs93vWyZm+1RzIpKCexxElmxl8g=" crossorigin="anonymous" defer></script>
    <script>
        var markdown = $(".markdown-body");
        //smooth all hash trigger scrolling
        function smoothHashScroll() {
            var hashElements = $("a[href^='#']").toArray();
            for (var i = 0; i < hashElements.length; i++) {
                var element = hashElements[i];
                var $element = $(element);
                var hash = element.hash;
                if (hash) {
                    $element.on('click', function (e) {
                        // store hash
                        var hash = this.hash;
                        if ($(hash).length <= 0) return;
                        // prevent default anchor click behavior
                        e.preventDefault();
                        // animate
                        $('body, html').stop(true, true).animate({
                            scrollTop: $(hash).offset().top
                        }, 100, "linear", function () {
                            // when done, add hash to url
                            // (default click behaviour)
                            window.location.hash = hash;
                        });
                    });
                }
            }
        }

        smoothHashScroll();
        var toc = $('.ui-toc');
        var tocAffix = $('.ui-affix-toc');
        var tocDropdown = $('.ui-toc-dropdown');
        //toc
        tocDropdown.click(function (e) {
            e.stopPropagation();
        });

        var enoughForAffixToc = true;

        function generateScrollspy() {
            $(document.body).scrollspy({
                target: ''
            });
            $(document.body).scrollspy('refresh');
            if (enoughForAffixToc) {
                toc.hide();
                tocAffix.show();
            } else {
                tocAffix.hide();
                toc.show();
            }
            $(document.body).scroll();
        }

        function windowResize() {
            //toc right
            var paddingRight = parseFloat(markdown.css('padding-right'));
            var right = ($(window).width() - (markdown.offset().left + markdown.outerWidth() - paddingRight));
            toc.css('right', right + 'px');
            //affix toc left
            var newbool;
            var rightMargin = (markdown.parent().outerWidth() - markdown.outerWidth()) / 2;
            //for ipad or wider device
            if (rightMargin >= 133) {
                newbool = true;
                var affixLeftMargin = (tocAffix.outerWidth() - tocAffix.width()) / 2;
                var left = markdown.offset().left + markdown.outerWidth() - affixLeftMargin;
                tocAffix.css('left', left + 'px');
            } else {
                newbool = false;
            }
            if (newbool != enoughForAffixToc) {
                enoughForAffixToc = newbool;
                generateScrollspy();
            }
        }
        $(window).resize(function () {
            windowResize();
        });
        $(document).ready(function () {
            windowResize();
            generateScrollspy();
        });

        //remove hash
        function removeHash() {
            window.location.hash = '';
        }

        var backtotop = $('.back-to-top');
        var gotobottom = $('.go-to-bottom');

        backtotop.click(function (e) {
            e.preventDefault();
            e.stopPropagation();
            if (scrollToTop)
                scrollToTop();
            removeHash();
        });
        gotobottom.click(function (e) {
            e.preventDefault();
            e.stopPropagation();
            if (scrollToBottom)
                scrollToBottom();
            removeHash();
        });

        var toggle = $('.expand-toggle');
        var tocExpand = false;

        checkExpandToggle();
        toggle.click(function (e) {
            e.preventDefault();
            e.stopPropagation();
            tocExpand = !tocExpand;
            checkExpandToggle();
        })

        function checkExpandToggle () {
            var toc = $('.ui-toc-dropdown .toc');
            var toggle = $('.expand-toggle');
            if (!tocExpand) {
                toc.removeClass('expand');
                toggle.text('Expand all');
            } else {
                toc.addClass('expand');
                toggle.text('Collapse all');
            }
        }

        function scrollToTop() {
            $('body, html').stop(true, true).animate({
                scrollTop: 0
            }, 100, "linear");
        }

        function scrollToBottom() {
            $('body, html').stop(true, true).animate({
                scrollTop: $(document.body)[0].scrollHeight
            }, 100, "linear");
        }
    </script>
</body>

</html>
