<div class="gmail_quote">On Wed, Jan 4, 2012 at 3:23 PM, Bradley Lowekamp <span dir="ltr"><<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">The signature of the concept is as follows:<div><br></div><div><div>template< typename T1, typename T2 = T1, typename T3 = T1 ></div><div>struct BracketOperator...</div><div><br></div>
<div>Using grep I found this usage in ITK:</div><div><br></div><div><div> itkConceptMacro( OutputPixelShouldHaveBracketOperator,</div><div> ( Concept::BracketOperator<</div><div> OutputPixelType,</div>
<div> unsigned int,</div><div> typename OutputPixelType::ValueType > ) );</div></div><div><br></div><div><br></div><div>So it looks like you should specify more template arguments to the concept.</div>
<div><br></div><div>You are correct that nameOfCheck can be any unique name for the scope the Concept Macro is in.</div><div><br></div><div>Hope this helps,</div><div>Brad</div></div></div></blockquote><div><br></div><div>
Thanks Brad, this does indeed work as I'd expect:</div><div class="gmail_quote">itkConceptMacro( nameOfCheck, ( itk::Concept::BracketOperator<T, unsigned int, typename T::ValueType> ) );</div><div class="gmail_quote">
<br></div><div>However, in the documentation: <a href="http://www.itk.org/Doxygen/html/structitk_1_1Concept_1_1BracketOperator.html">http://www.itk.org/Doxygen/html/structitk_1_1Concept_1_1BracketOperator.html</a> it states:</div>
<div><br></div>"Concept requiring T1 to have operators [] in the form T1 [] T2 = T3."</div><div class="gmail_quote"><br></div><div class="gmail_quote">Is this supposed to read T3 = T1[T2] ?</div><div class="gmail_quote">
<br></div><div class="gmail_quote">I.e. </div><div class="gmail_quote"><br></div><div class="gmail_quote">float = VariableLengthVector[unsigned int] </div><div class="gmail_quote"><br></div><div class="gmail_quote"><div class="gmail_quote">
I'm confused because this also works:</div><div class="gmail_quote">itkConceptMacro( nameOfCheck, ( itk::Concept::BracketOperator<T, unsigned int> ) );</div><div class="gmail_quote"><br></div><div class="gmail_quote">
and since the default arguments are:</div><div class="gmail_quote">template< typename T1, typename T2 = T1, typename T3 = T1 ></div><div class="gmail_quote"><br></div><div class="gmail_quote">I would think this means:</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">VariableLengthVector = VariableLengthVector[unsigned int] </div><div class="gmail_quote"><br></div><div class="gmail_quote">which is not the case. Am I misunderstanding the notation?</div>
<div class="gmail_quote"><br></div>Thanks,<br><br><div>David </div></div>