[완료] 템플릿과 일반클래스를 상속한 템플릿 클래스

purewell의 이미지

template <typename T>
class TParent
{
// blar blar...
};
 
class CInterface
{
  virtual const char* what(void) const = 0;
};
 
template <typename T>
class TChild : public CInterface, public TParent<typename T>
{
  virtual const char* what(void) const
  {
    return &T;
  }
};

이렇게 하나는 템플릿이고 다른 하나는 일반 클래스를 상속 받는 템플릿 클래스를 만들 수 있나요? 컴파일해보니, 템플릿 첫번째 인자가 invalid하다고 나오네요.

tmp.h:1: error: template argument 1 is invalid
tmp.h:2: error: expected class-name before '(' token

imyejin의 이미지

class TChild : public CInterface, public TParent&lt;typename T&gt;

이게 틀렸습니다. 그냥 TParent<T> 죠.
template parameter application 을 해야 할 곳에 template parameter declaration 을 하려 하고 있으니 문법 에러입니다.
말하자면 f(a) 를 해야 할 곳에 f(int a) 하고 있는 셈입니다.

이거 lt gt 이렇게 안쓰고 그냥 꺾쇠들 쓰니까 태그로 인식하는지 무시하는데요, 코드 입력할 때 이거 좀 처리되게 하는 방법 없나요?

Full HTML 옵션 놓고 pre 환경 쓰면 되려나?

임예진 팬클럽 ♡예진아씨♡ http://cafe.daum.net/imyejin

[예진아씨 피카사 웹앨범] 임예진 팬클럽 ♡예진아씨♡ http://cafe.daum.net/imyejin

imyejin의 이미지

다음은 pre 환경입니다.


 > > > > < 되려나?

@ pre 환경이 제대로 된 pre 환경이 아니군요 gt lt 이런 거 원래 pre 환경 안에서는 변환 안하는 걸로 알고 있는데 해버리네요

제 시그에 쓰는 html 은 다음과 같죠


임예진 팬클럽 ♡예진아씨♡ http://cafe.daum.net/imyejin

@ 마찬가지로 이미지나 앵커에 대해서도 pre 가 제대로 동작하지 않는군요. 드루팔 잘 쓰시는 분들이 버그 리포트 해주세요.

@@ 좋은 정보라 생각되시면 예진아씨 팬카페 가입 감사!


임예진 팬클럽 ♡예진아씨♡ http://cafe.daum.net/imyejin

[예진아씨 피카사 웹앨범] 임예진 팬클럽 ♡예진아씨♡ http://cafe.daum.net/imyejin

purewell의 이미지

좋은 정보 감사합니다. 그러나 가입은 안 한다는거~
_____________________________
언제나 맑고픈 샘이가...
http://purewell.biz

_____________________________
언제나 맑고픈 샘이가...
http://purewell.biz

imyejin의 이미지

가입 좀 해주세효 ㅠ,ㅜ
거 뭐 돈드는 것도 아닌데 . . .

임예진 팬클럽 ♡예진아씨♡ http://cafe.daum.net/imyejin

[예진아씨 피카사 웹앨범] 임예진 팬클럽 ♡예진아씨♡ http://cafe.daum.net/imyejin

ktd2004의 이미지

개인적인 궁금함으로 질문드립니다.

imyejin님은 어떤 일을 하시고 계신가요?
포스팅한 글들을 보면 프로그램쪽에 계시는 것 같은데요. ^^;

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.