Function: semantic-c-dereference-template

semantic-c-dereference-template is a byte-compiled function defined in c.el.gz.

Signature

(semantic-c-dereference-template TYPE SCOPE &optional TYPE-DECLARATION)

Documentation

Dereference any template specifiers in TYPE within SCOPE.

If TYPE is a template, return a TYPE copy with the templates types instantiated as specified in TYPE-DECLARATION.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/bovine/c.el.gz
(defun semantic-c-dereference-template (type _scope &optional type-declaration)
  "Dereference any template specifiers in TYPE within SCOPE.
If TYPE is a template, return a TYPE copy with the templates types
instantiated as specified in TYPE-DECLARATION."
  (when (semantic-tag-p type-declaration)
    (let ((def-list  (semantic-tag-get-attribute type :template))
          (spec-list (semantic-tag-get-attribute type-declaration :template-specifier)))
      (when (and def-list spec-list)
        (setq type (semantic-tag-deep-copy-one-tag
		    type
		    (lambda (tag)
		      (when (semantic-tag-of-class-p tag 'type)
			(semantic-c--instantiate-template
			 tag def-list spec-list))
		      tag)
		    ))
        (semantic-tag-set-name type (semantic-c--template-name type spec-list))
        (semantic-tag-put-attribute type :template nil)
        (semantic-tag-set-faux type))))
  (list type type-declaration))